﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_TraTruocNguoiBan : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvKhachHang")]
        private ADVObjects _AdvKhachHang;
        [AccessedThroughProperty("AdvNganHang")]
        private ADVObjects _AdvNganHang;
        [AccessedThroughProperty("AdvTaiKhoan")]
        private ADVAccount _AdvTaiKhoan;
        [AccessedThroughProperty("CboLoaiKhachHang")]
        private ComboBox _CboLoaiKhachHang;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("cboLoaiTienKhaiBaoThue")]
        private ComboBox _cboLoaiTienKhaiBaoThue;
        [AccessedThroughProperty("CboPhuongThuc")]
        private ComboBox _CboPhuongThuc;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripSplitButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdThemDongChiPhi")]
        private Button _CmdThemDongChiPhi;
        [AccessedThroughProperty("CmdThemDongChiTiet")]
        private Button _CmdThemDongChiTiet;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("CmdXemDinhKhoan")]
        private ToolStripButton _CmdXemDinhKhoan;
        [AccessedThroughProperty("CmdXoaDongChiPhi")]
        private Button _CmdXoaDongChiPhi;
        [AccessedThroughProperty("CmdXoaDongChiTiet")]
        private Button _CmdXoaDongChiTiet;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("Panel6")]
        private Panel _Panel6;
        [AccessedThroughProperty("PrintCT")]
        private ToolStripMenuItem _PrintCT;
        [AccessedThroughProperty("PrintTH")]
        private ToolStripMenuItem _PrintTH;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabControl2")]
        private TabControl _TabControl2;
        [AccessedThroughProperty("TabControl3")]
        private TabControl _TabControl3;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("TabPage3")]
        private TabPage _TabPage3;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChiPhi")]
        private C1NumericEdit _TxtChiPhi;
        [AccessedThroughProperty("TxtChiPhiNT")]
        private C1NumericEdit _TxtChiPhiNT;
        [AccessedThroughProperty("TxtChiPhiTruocThue")]
        private C1NumericEdit _TxtChiPhiTruocThue;
        [AccessedThroughProperty("TxtConDu")]
        private C1NumericEdit _TxtConDu;
        [AccessedThroughProperty("TxtConDuNT")]
        private C1NumericEdit _TxtConDuNT;
        [AccessedThroughProperty("TxtDienGiaiAnh")]
        private TextBox _TxtDienGiaiAnh;
        [AccessedThroughProperty("TxtDienGiaiViet")]
        private TextBox _TxtDienGiaiViet;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNguoiNhan")]
        private TextBox _TxtNguoiNhan;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoTienNhan")]
        private C1NumericEdit _TxtSoTienNhan;
        [AccessedThroughProperty("TxtSoTienNhanNT")]
        private C1NumericEdit _TxtSoTienNhanNT;
        [AccessedThroughProperty("TxtSoTienTamUng")]
        private C1NumericEdit _TxtSoTienTamUng;
        [AccessedThroughProperty("TxtSoTienTamUngNT")]
        private C1NumericEdit _TxtSoTienTamUngNT;
        [AccessedThroughProperty("TxtTongCongThueChiPhi")]
        private C1NumericEdit _TxtTongCongThueChiPhi;
        [AccessedThroughProperty("TxtTongTienTamUng")]
        private C1NumericEdit _TxtTongTienTamUng;
        [AccessedThroughProperty("TxtTongTienTamUngNT")]
        private C1NumericEdit _TxtTongTienTamUngNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("TxtTyGiaChoThue")]
        private C1NumericEdit _TxtTyGiaChoThue;
        [AccessedThroughProperty("TxtVAT")]
        private C1NumericEdit _TxtVAT;
        [AccessedThroughProperty("VSlistChiPhi")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlistChiPhi;
        [AccessedThroughProperty("VSlistChiTietTamUng")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlistChiTietTamUng;
        private string cFrmFormat;
        private string cFrmFormat_;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        public bool mNotShow;
        private clsSoChungTu objSoCT;
        private clsTamUngNhaCungCap objTUNCC;
        private clsTamUngNhaCungCapChiTiet objTUNCCCT;
        private clsTamUngNhaCungCapChiTietChiPhi objTUNCCCTCP;

        public Frm_TraTruocNguoiBan()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_TraTruocNguoiBan_KeyDown);
            base.Load += new EventHandler(this.Frm_TamUngNhaCungCap_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.cFrmTask = "";
            this.objSoCT = new clsSoChungTu();
            this.objTUNCCCT = new clsTamUngNhaCungCapChiTiet();
            this.objTUNCC = new clsTamUngNhaCungCap();
            this.objTUNCCCTCP = new clsTamUngNhaCungCapChiTietChiPhi();
            this.mLoaiChungTu = "TTNB";
            this.cFrmFormat_ = "###,###,###,###,###,###,###,##0.00";
            this.mNotShow = false;
            this.InitializeComponent();
        }

        private void AdvKhachHang_ValueChanged(object sender, EventArgs e)
        {
            this.TxtNguoiNhan.Text = this.AdvKhachHang.TxtName.Text;
        }

        private void AdvNganHang_ValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (Conversions.ToInteger(LVYModule.ReturnIfNull(this.AdvTaiKhoan.TxtCode.Text.ToString(), 0, modGeneral.TypeOfValue.Nothing).ToString().Substring(0, 3)) != 0x8d)
                {
                    int num3 = this.VSlistChiPhi.Rows.Count - 1;
                    for (int i = 2; i <= num3; i++)
                    {
                        this.VSlistChiPhi[i, 6] = this.AdvNganHang.Value;
                        this.VSlistChiPhi[i, 7] = this.AdvNganHang.TxtCode.Text;
                        this.VSlistChiPhi[i, 8] = this.AdvNganHang.TxtName.Text;
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void AdvTaiKhoan_ValueChanged(object sender, EventArgs e)
        {
            this.AdvNganHang.ReadOnly = true;
            try
            {
                int num = Conversions.ToInteger(LVYModule.ReturnIfNull(this.AdvTaiKhoan.TxtCode.Text.ToString(), 0, modGeneral.TypeOfValue.Nothing).ToString().Substring(0, 3));
                if (num == 0x70)
                {
                    this.AdvNganHang.ReadOnly = false;
                }
                else if (num == 0x8d)
                {
                    this.AdvNganHang.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
                    this.AdvNganHang.ReadOnly = false;
                    this.Label6.Text = "Nh\x00e2n vi\x00ean";
                }
                else
                {
                    this.AdvNganHang.Value = "";
                    this.AdvNganHang.ReadOnly = true;
                    this.Label6.Text = "Ng\x00e2n h\x00e0ng";
                }
                if (this.AdvNganHang.Value == "")
                {
                    int num3 = this.VSlistChiPhi.Rows.Count - 1;
                    for (int i = 2; i <= num3; i++)
                    {
                        this.VSlistChiPhi[i, 6] = "";
                        this.VSlistChiPhi[i, 7] = "";
                        this.VSlistChiPhi[i, 8] = "";
                    }
                }
                if ((this.AdvTaiKhoan.TxtCode.Text.ToString() == "1112") | (this.AdvTaiKhoan.TxtCode.Text.ToString() == "1122"))
                {
                    this.mNotShow = true;
                    this.CboLoaiTien.SelectedIndex = 1;
                }
                else
                {
                    this.mNotShow = true;
                    this.CboLoaiTien.SelectedIndex = 0;
                }
                this.mNotShow = false;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void CboLoaiKhachHang_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (this.CboLoaiKhachHang.Text.Trim() != "")
                {
                    this.CmdThemDongChiTiet.Enabled = true;
                    this.CmdXoaDongChiTiet.Enabled = true;
                }
                else
                {
                    this.CmdThemDongChiTiet.Enabled = false;
                    this.CmdXoaDongChiTiet.Enabled = false;
                    this.VSlistChiTietTamUng.Rows.Count = 2;
                    this.VSlistChiPhi.Rows.Count = 2;
                }
                clsDMTaiKhoan khoan = new clsDMTaiKhoan();
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.CboLoaiKhachHang.SelectedValue, "TN", false))
                {
                    khoan.LoadByCode("3310");
                }
                else
                {
                    khoan.LoadByCode("3311");
                }
                int num2 = this.VSlistChiTietTamUng.Rows.Count - 1;
                for (int i = 2; i <= num2; i++)
                {
                    this.VSlistChiTietTamUng[i, 3] = khoan.Khoa;
                    this.VSlistChiTietTamUng[i, 4] = khoan.SoTaiKhoan;
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if ((this.AdvTaiKhoan.Value != "") & !this.mNotShow)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Vui l\x00f2ng chọn lại T\x00e0i khoản ghi C\x00f3 sau bạn khi thay đổi loại tiền!", ""));
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
                {
                    this.txtTyGia.Value = 0;
                }
                else
                {
                    string strCode = this.CboLoaiTien.SelectedValue.ToString();
                    if (strCode != "System.Data.DataRowView")
                    {
                        clsDMLoaiTien tien = new clsDMLoaiTien();
                        tien.LoadByCode(strCode);
                        if (tien.SoLe > 0)
                        {
                            this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("0000000000", tien.SoLe);
                        }
                        if (tien.TienViet == 1)
                        {
                            this.txtTyGia.Enabled = false;
                        }
                        else
                        {
                            this.txtTyGia.Enabled = true;
                        }
                        this.txtTyGia.Value = tien.TyGia;
                        this.TxtTyGiaChoThue.Value = tien.TyGia;
                        if ((this.TxtTongTienTamUngNT.Text.ToString().Trim() != "") & Conversions.ToBoolean(this.txtTyGia.Text.ToString().Trim()))
                        {
                            double num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
                            double num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                            this.TxtTongTienTamUng.Value = num3 * num2;
                        }
                        int num4 = this.VSlistChiTietTamUng.Rows.Count - 1;
                        for (int i = 2; i <= num4; i++)
                        {
                            this.VSlistChiTietTamUng[i, 5] = this.CboLoaiTien.SelectedValue.ToString();
                            this.VSlistChiTietTamUng[i, 6] = this.CboLoaiTien.Text.ToString();
                            this.VSlistChiTietTamUng[i, 7] = this.txtTyGia.Text.ToString();
                            RowColEventArgs args = new RowColEventArgs(i, 8);
                            this.VSlistChiTietTamUng_AfterEdit(this, args);
                        }
                        this.cboLoaiTienKhaiBaoThue.SelectedValue = RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue);
                        this.FormatNumber(this.cFrmFormat_);
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void cboLoaiTienKhaiBaoThue_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.cboLoaiTienKhaiBaoThue.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
                {
                    this.TxtTyGiaChoThue.Value = 0;
                }
                else
                {
                    string strCode = this.cboLoaiTienKhaiBaoThue.SelectedValue.ToString();
                    if (strCode != "System.Data.DataRowView")
                    {
                        clsDMLoaiTien tien = new clsDMLoaiTien();
                        tien.LoadByCode(strCode);
                        if (tien.SoLe > 0)
                        {
                            this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("0000000000", tien.SoLe);
                        }
                        if (tien.TienViet == 1)
                        {
                            this.TxtTyGiaChoThue.Enabled = false;
                        }
                        else
                        {
                            this.TxtTyGiaChoThue.Enabled = true;
                        }
                        this.TxtTyGiaChoThue.Value = tien.TyGia;
                        int num2 = this.VSlistChiPhi.Rows.Count - 1;
                        for (int i = 2; i <= num2; i++)
                        {
                            this.VSlistChiPhi[i, 9] = this.cboLoaiTienKhaiBaoThue.SelectedValue.ToString();
                            this.VSlistChiPhi[i, 10] = this.cboLoaiTienKhaiBaoThue.Text.ToString();
                            this.VSlistChiPhi[i, 11] = RuntimeHelpers.GetObjectValue(this.TxtTyGiaChoThue.Value);
                        }
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void CboPhuongThuc_SelectedIndexChanged(object sender, EventArgs e)
        {
            clsDMPhuongThucTamUng ung = new clsDMPhuongThucTamUng();
            if (this.mEnabledControl && !Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboPhuongThuc.SelectedValue), "", modGeneral.TypeOfValue.Nothing), "", false))
            {
                string str = "";
                str = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboPhuongThuc.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
                this.AdvTaiKhoan.ReadOnly = false;
                this.AdvNganHang.ReadOnly = true;
                switch (str)
                {
                    case "TT0000000000010":
                        this.AdvTaiKhoan.KeyFilter = "112";
                        this.AdvNganHang.LoaiDoiTuong = modGeneral.TypeObjects.NganHang;
                        this.AdvTaiKhoan.Value = "";
                        this.AdvNganHang.Value = "";
                        this.Label6.Text = "Ng\x00e2n h\x00e0ng";
                        return;

                    case "TT0000000000011":
                        this.AdvTaiKhoan.KeyFilter = "111";
                        this.AdvTaiKhoan.Value = "";
                        this.AdvNganHang.Value = "";
                        this.Label6.Text = "Ng\x00e2n h\x00e0ng";
                        return;
                }
                if (str == "TT0000000000012")
                {
                    this.AdvTaiKhoan.KeyFilter = "211|212|213|217";
                    this.AdvTaiKhoan.Value = "";
                    this.AdvNganHang.Value = "";
                    this.Label6.Text = "Ng\x00e2n h\x00e0ng";
                }
                else
                {
                    this.AdvTaiKhoan.KeyFilter = "113|121|128|136|138|141|144|221|222|228|241|244";
                    this.AdvTaiKhoan.Value = "";
                    this.AdvNganHang.Value = "";
                }
            }
        }

        public bool CheckIvalid()
        {
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.CboPhuongThuc.SelectedValue, "", false))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập phương thức!", ""));
                this.CboPhuongThuc.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ kh\x00f4ng được để trống! Bạn vui l\x00f2ng nhập số chứng từ.", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập th\x00f4ng tin người b\x00e1n!", ""));
                this.AdvKhachHang.Focus();
                return false;
            }
            if (this.TxtNguoiNhan.Text.ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập th\x00f4ng tin người nhận tiền!", ""));
                this.TxtNguoiNhan.Focus();
                return false;
            }
            if (this.TxtDienGiaiViet.Text.ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập diễn giải tiếng việt!", ""));
                this.TxtDienGiaiViet.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvTaiKhoan.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập t\x00e0i khoản C\x00f3!", ""));
                this.AdvTaiKhoan.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập loại tiền trả trước!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số tiền trả trước!", ""));
                this.TxtTongTienTamUngNT.Focus();
                return false;
            }
            return true;
        }

        public bool CheckValidForSave()
        {
            int num;
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.CboPhuongThuc.SelectedValue, "", false))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập phương thức!", ""));
                this.CboPhuongThuc.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ kh\x00f4ng được để trống! Bạn vui l\x00f2ng nhập số chứng từ.", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập th\x00f4ng tin người b\x00e1n!", ""));
                this.AdvKhachHang.Focus();
                return false;
            }
            if (this.TxtNguoiNhan.Text.ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập th\x00f4ng tin người nộp!", ""));
                this.TxtNguoiNhan.Focus();
                return false;
            }
            if (this.TxtDienGiaiViet.Text.ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập diễn giải tiếng việt!", ""));
                this.TxtDienGiaiViet.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvTaiKhoan.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập t\x00e0i khoản C\x00f3!", ""));
                this.AdvTaiKhoan.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập loại tiền trả trước!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số tiền trả trước!", ""));
                this.TxtTongTienTamUngNT.Focus();
                return false;
            }
            if ((Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtConDu.Value), 0, modGeneral.TypeOfValue.Nothing)) != 0.0) | (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtConDuNT.Value), 0, modGeneral.TypeOfValue.Nothing)) != 0.0))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("C\x00e2n đối chưa bằng ! Vui l\x00f2ng kiểm tra lại ", ""));
                this.TxtConDu.Focus();
                return false;
            }
            if ((this.AdvNganHang.Value.Trim() == "") && (Conversions.ToDouble(LVYModule.ReturnIfNull(this.AdvTaiKhoan.TxtCode.Text.Substring(0, 3), 0, modGeneral.TypeOfValue.Nothing)) == 112.0))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng chọn ng\x00e2n h\x00e0ng!", ""));
                this.AdvNganHang.Focus();
                return false;
            }
            if ((this.AdvNganHang.Value.Trim() == "") && (Conversions.ToDouble(LVYModule.ReturnIfNull(this.AdvTaiKhoan.TxtCode.Text.Substring(0, 3), 0, modGeneral.TypeOfValue.Nothing)) == 141.0))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng chọn nh\x00e2n vi\x00ean!", ""));
                this.AdvNganHang.Focus();
                return false;
            }
            string str = "";
            string str2 = "";
            string str3 = "";
            string str4 = "";
            int num2 = this.VSlistChiTietTamUng.Rows.Count - 1;
            for (num = 2; num <= num2; num++)
            {
                str = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[num, 1]), "", modGeneral.TypeOfValue.Nothing));
                str2 = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[num, 2]), "", modGeneral.TypeOfValue.Nothing));
                str3 = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[num, 12]), "", modGeneral.TypeOfValue.Nothing));
                if (str.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số chứng từ (th\x00f4ng tin chi tiết) trước khi lưu!", ""));
                    this.VSlistChiTietTamUng.Focus();
                    return false;
                }
                if (str2.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập ng\x00e0y chứng từ (th\x00f4ng tin chi tiết) trước khi lưu!", ""));
                    this.VSlistChiTietTamUng.Focus();
                    return false;
                }
                if (str3.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập diễn giải tiếng Việt (th\x00f4ng tin chi tiết) trước khi lưu!", ""));
                    this.VSlistChiTietTamUng.Focus();
                    return false;
                }
            }
            string str5 = "";
            string str6 = "";
            int num3 = this.VSlistChiPhi.Rows.Count - 1;
            for (num = 2; num <= num3; num++)
            {
                str2 = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[num, 4]), "", modGeneral.TypeOfValue.Nothing));
                str3 = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[num, 0x13]), "", modGeneral.TypeOfValue.Nothing));
                str4 = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[num, 20]), "", modGeneral.TypeOfValue.Nothing));
                str5 = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[num, 1]), "", modGeneral.TypeOfValue.Nothing));
                str6 = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[num, 2]), "", modGeneral.TypeOfValue.Nothing));
                if (str5.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số chứng từ (th\x00f4ng tin chi ph\x00ed) trước khi lưu!", ""));
                    this.VSlistChiTietTamUng.Focus();
                    return false;
                }
                if (str6.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập ng\x00e0y chứng từ (th\x00f4ng tin chi ph\x00ed) trước khi lưu!", ""));
                    this.VSlistChiTietTamUng.Focus();
                    return false;
                }
                if (str2.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số t\x00e0i khoản ghi Nợ (th\x00f4ng tin chi ph\x00ed) trước khi lưu!", ""));
                    this.VSlistChiTietTamUng.Focus();
                    return false;
                }
                if (str3.Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập diễn giải tiếng Việt (th\x00f4ng tin chi ph\x00ed) trước khi lưu!", ""));
                    this.VSlistChiTietTamUng.Focus();
                    return false;
                }
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.EmptyFooter();
            this.cFrmKhoa = modGeneral.CreatKey("GL_TamUngNhaCungCap", 15, "TU");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.AdvTaiKhoan.Value = LVYModule.ReturnIfNull(modGeneral.H_ACCNORECEIPTNOTE, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            this.EnabledControl = true;
            this.CboLoaiTien.SelectedIndex = 0;
            this.AdvTaiKhoan.ReadOnly = true;
            this.AdvNganHang.ReadOnly = true;
            this.CmdThemDongChiTiet.Enabled = false;
            this.CmdXoaDongChiTiet.Enabled = false;
            this.TxtSoChungTu.Focus();
            this.InitDefault();
            this.cFrmTask = "I";
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((this.cFrmKhoa != "") && LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text))) && (LVYModule.ConfirmDelete("") && this.objTUNCC.DelData(this.cFrmKhoa)))
            {
                this.EmptyData();
                this.EmptyFooter();
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
                this.cFrmTask = "";
                this.EnabledControl = true;
                this.VSlistChiPhi.Enabled = true;
                this.VSlistChiTietTamUng.Enabled = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_TraTruocNguoiBanList.Show();
            MyProject.Forms.Frm_TraTruocNguoiBanList.BringToFront();
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckValidForSave())
            {
                if (!this.SaveDetailsTemp())
                {
                    this.objTUNCC.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.SaveDetailsTempChiPhi())
                {
                    this.objTUNCC.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.UpdateData())
                {
                    this.objTUNCC.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objTUNCC.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                    this.VSlistChiTietTamUng.Enabled = false;
                    this.VSlistChiPhi.Enabled = false;
                    this.cFrmTask = "";
                }
            }
        }

        private void CmdThemDongChiPhi_Click(object sender, EventArgs e)
        {
            try
            {
                if ((Conversions.ToDouble(this.TxtConDu.Value) != 0.0) | (Conversions.ToDouble(this.TxtConDuNT.Value) != 0.0))
                {
                    if (this.VSlistChiTietTamUng.Rows.Count == 2)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập th\x00f4ng tin chi tiết tạm ứng trước khi nhập th\x00f4ng tin chi ph\x00ed!", ""));
                    }
                    else if (this.CheckIvalid())
                    {
                        this.VSlistChiPhi.Enabled = true;
                        C1.Win.C1FlexGrid.C1FlexGrid vSlistChiPhi = this.VSlistChiPhi;
                        vSlistChiPhi.AddItem("");
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 1] = this.TxtSoChungTu.Text.ToString();
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 2] = this.TxtNgayChungTu.Value.ToString();
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 3] = "";
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 4] = "";
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 5] = "";
                        if (Conversions.ToInteger(LVYModule.ReturnIfNull(this.AdvTaiKhoan.TxtCode.Text.ToString(), 0, modGeneral.TypeOfValue.Nothing).ToString().Substring(0, 3)) == 0x8d)
                        {
                            vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 6] = "";
                            vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 7] = "";
                            vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 8] = "";
                        }
                        else
                        {
                            vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 6] = this.AdvNganHang.Value;
                            vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 7] = this.AdvNganHang.TxtCode.Text.ToString();
                            vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 8] = this.AdvNganHang.TxtName.Text.ToString();
                        }
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 9] = this.CboLoaiTien.SelectedValue.ToString();
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 10] = this.CboLoaiTien.Text.ToString();
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 11] = this.TxtTyGiaChoThue.Text.ToString();
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 12] = this.TxtConDuNT.Value.ToString();
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 13] = this.TxtConDu.Value.ToString();
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 14] = 0;
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 15] = 0;
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 0x10] = 0;
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 0x11] = 0;
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 0x12] = 0;
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 0x13] = "Tiền ph\x00ed ng\x00e2n h\x00e0ng";
                        vSlistChiPhi[this.VSlistChiPhi.Rows.Count - 1, 20] = "Bank charge";
                        vSlistChiPhi = null;
                        this.TinhTong();
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void CmdThemDongChiTiet_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                this.VSlistChiTietTamUng.Enabled = true;
                C1.Win.C1FlexGrid.C1FlexGrid vSlistChiTietTamUng = this.VSlistChiTietTamUng;
                vSlistChiTietTamUng.AddItem("");
                clsDMTaiKhoan khoan = new clsDMTaiKhoan();
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.CboLoaiKhachHang.SelectedValue, "TN", false))
                {
                    khoan.LoadByCode("3310");
                }
                else
                {
                    khoan.LoadByCode("3311");
                }
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 3] = khoan.Khoa;
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 4] = khoan.SoTaiKhoan;
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 5] = this.CboLoaiTien.SelectedValue.ToString();
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 6] = this.CboLoaiTien.Text.ToString();
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 7] = this.txtTyGia.Text.ToString();
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 8] = 0;
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 9] = 0;
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 10] = 0;
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 11] = 0;
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 12] = this.TxtDienGiaiViet.Text.ToString();
                vSlistChiTietTamUng[this.VSlistChiTietTamUng.Rows.Count - 1, 13] = this.TxtDienGiaiAnh.Text.ToString();
                vSlistChiTietTamUng = null;
                this.TinhTong();
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            this.mNotShow = true;
            if (this.cFrmKhoaOld.Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
                this.EmptyFooter();
            }
            if (this.cFrmTask == "I")
            {
                this.objSoCT.UndoVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
            }
            this.cFrmTask = "";
            this.EnabledControl = false;
            this.VSlistChiPhi.Enabled = false;
            this.VSlistChiTietTamUng.Enabled = false;
            this.TinhTong();
        }

        private void CmdXemDinhKhoan_Click(object sender, EventArgs e)
        {
            if (!Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing), "", false))
            {
                try
                {
                    IDataParameter[] commandParameters = new IDataParameter[3];
                    commandParameters[0] = DBHelper.createParameter("@Khoa", DbType.Int64, ParameterDirection.Input, this.cFrmKhoa);
                    commandParameters[1] = DBHelper.createParameter("@pError", DbType.Int64, ParameterDirection.Output, 0);
                    DataTable table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "GL_sp_XemDinhKhoanTamUngNhaCungCap", commandParameters).Tables[0];
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.DataSource = table;
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.Cols[2].Format = this.cFrmFormat;
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.Cols[0].Caption = "Nợ";
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.Cols[0].TextAlignFixed = TextAlignEnum.CenterCenter;
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.Cols[1].Caption = "C\x00f3";
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.Cols[1].TextAlignFixed = TextAlignEnum.CenterCenter;
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.Cols[2].Caption = "Số tiền ghi sổ";
                    MyProject.Forms.Frm_XemDinhKhoan.VSlist.Cols[2].TextAlignFixed = TextAlignEnum.CenterCenter;
                    MyProject.Forms.Frm_XemDinhKhoan.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message);
                    ProjectData.ClearProjectError();
                    return;
                    ProjectData.ClearProjectError();
                }
            }
        }

        private void CmdXoaDongChiPhi_Click(object sender, EventArgs e)
        {
            if ((this.VSlistChiPhi.Rows.Count != 2) && (this.VSlistChiPhi.Row > 0))
            {
                this.VSlistChiPhi.RemoveItem(this.VSlistChiPhi.Row);
                this.TinhTong();
            }
        }

        private void CmdXoaDongChiTiet_Click(object sender, EventArgs e)
        {
            if ((this.VSlistChiTietTamUng.Rows.Count != 1) && (this.VSlistChiTietTamUng.Row > 0))
            {
                this.VSlistChiTietTamUng.RemoveItem(this.VSlistChiTietTamUng.Row);
                this.TinhTong();
                if (this.VSlistChiTietTamUng.Rows.Count == 2)
                {
                    this.VSlistChiPhi.Rows.Count = 2;
                }
            }
        }

        public void CreateDatatableLoaiKhachHang()
        {
            DataTable table = new DataTable();
            table.Columns.Add("Loai", System.Type.GetType("System.String"));
            table.Columns.Add("Ten", System.Type.GetType("System.String"));
            DataRow row = table.NewRow();
            row["Loai"] = "";
            row["Ten"] = "";
            table.Rows.Add(row);
            row = table.NewRow();
            row["Loai"] = "TN";
            row["Ten"] = "Người b\x00e1n trong nước";
            table.Rows.Add(row);
            row = table.NewRow();
            row["Loai"] = "NN";
            row["Ten"] = "Người b\x00e1n nước ngo\x00e0i";
            table.Rows.Add(row);
            this.CboLoaiKhachHang.DataSource = table;
            this.CboLoaiKhachHang.DisplayMember = "Ten";
            this.CboLoaiKhachHang.ValueMember = "Loai";
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        public void EmptyData()
        {
            this.CboPhuongThuc.SelectedValue = "";
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiKhachHang.Text = "";
            this.TxtNguoiNhan.Text = "";
            this.TxtDienGiaiViet.Text = "";
            this.AdvTaiKhoan.Value = "";
            this.AdvNganHang.Value = "";
            this.AdvKhachHang.Value = "";
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtTongTienTamUngNT.Value = "";
            this.TxtTongTienTamUng.Value = "";
            this.TxtDienGiaiAnh.Text = "";
            this.TxtTyGiaChoThue.Value = "";
            this.VSlistChiPhi.Rows.Count = 2;
            this.VSlistChiTietTamUng.Rows.Count = 2;
        }

        public void EmptyFooter()
        {
            this.TxtSoTienTamUngNT.Value = "";
            this.TxtSoTienNhanNT.Value = "";
            this.TxtChiPhiNT.Value = "";
            this.TxtConDuNT.Value = "";
            this.TxtSoTienTamUng.Value = "";
            this.TxtSoTienNhan.Value = "";
            this.TxtChiPhi.Value = "";
            this.TxtConDu.Value = "";
            this.TxtChiPhiTruocThue.Value = "";
            this.TxtTongCongThueChiPhi.Value = "";
            this.TxtVAT.Value = "";
        }

        public void FormatNumber(string format)
        {
            LVYModule.advFormatNumber(this.txtTyGia, format);
            LVYModule.advFormatNumber(this.TxtTyGiaChoThue, format);
            LVYModule.advFormatNumber(this.TxtTongTienTamUngNT, format);
            LVYModule.advFormatNumber(this.TxtTongTienTamUng, format);
            LVYModule.advFormatNumber(this.TxtSoTienTamUngNT, format);
            LVYModule.advFormatNumber(this.TxtSoTienTamUng, format);
            LVYModule.advFormatNumber(this.TxtSoTienNhanNT, format);
            LVYModule.advFormatNumber(this.TxtSoTienNhan, format);
            LVYModule.advFormatNumber(this.TxtConDuNT, format);
            LVYModule.advFormatNumber(this.TxtConDu, format);
            LVYModule.advFormatNumber(this.TxtChiPhiNT, format);
            LVYModule.advFormatNumber(this.TxtChiPhi, format);
            LVYModule.advFormatNumber(this.TxtChiPhiTruocThue, format);
            LVYModule.advFormatNumber(this.TxtVAT, format);
            LVYModule.advFormatNumber(this.TxtTongCongThueChiPhi, format);
            this.TxtSoChungTu.Text = this.TxtSoChungTu.Text.ToUpper();
        }

        private void Frm_TamUngNhaCungCap_Load(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_TraTruocNguoiBanList.Dispose();
            this.Cursor = Cursors.WaitCursor;
            this.EnabledControl = false;
            BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
            BuildComboModule.BuildCombo(this.cboLoaiTienKhaiBaoThue, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
            BuildComboModule.BuildCombo(this.CboPhuongThuc, modGeneral.ListDanhMuc.PhuongThucTamUng, false, "", "");
            this.CreateDatatableLoaiKhachHang();
            this.MergCell();
            this.cFrmFormat = modGeneral.H_FORMATNUMBER;
            this.VSlistChiPhi.Enabled = false;
            this.VSlistChiTietTamUng.Enabled = false;
            this.Cursor = Cursors.Default;
            if (this.cFrmKhoa.Trim() != "")
            {
                this.ShowData(this.cFrmKhoa);
                this.TinhTong();
            }
            this.FormatNumber(this.cFrmFormat_);
            this.BringToFront();
        }

        private void Frm_TraTruocNguoiBan_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F11) && this.CmdUnsave.Enabled)
            {
                this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        public void InitDefault()
        {
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_TraTruocNguoiBan));
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripSplitButton();
            this.PrintTH = new ToolStripMenuItem();
            this.PrintCT = new ToolStripMenuItem();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHelp = new ToolStripButton();
            this.ToolStrip1 = new ToolStrip();
            this.CmdXemDinhKhoan = new ToolStripButton();
            this.TabControl1 = new TabControl();
            this.TabPage1 = new TabPage();
            this.Label6 = new Label();
            this.TxtDienGiaiAnh = new TextBox();
            this.TxtDienGiaiViet = new TextBox();
            this.Label18 = new Label();
            this.Label5 = new Label();
            this.TxtNguoiNhan = new TextBox();
            this.Label12 = new Label();
            this.Label9 = new Label();
            this.CboPhuongThuc = new ComboBox();
            this.CboLoaiTien = new ComboBox();
            this.TxtTongTienTamUngNT = new C1NumericEdit();
            this.TxtTongTienTamUng = new C1NumericEdit();
            this.txtTyGia = new C1NumericEdit();
            this.Label4 = new Label();
            this.Label8 = new Label();
            this.Label7 = new Label();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label2 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.TabControl2 = new TabControl();
            this.TabPage2 = new TabPage();
            this.Panel4 = new Panel();
            this.VSlistChiTietTamUng = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel3 = new Panel();
            this.CmdXoaDongChiTiet = new Button();
            this.CmdThemDongChiTiet = new Button();
            this.CboLoaiKhachHang = new ComboBox();
            this.Label21 = new Label();
            this.TabControl3 = new TabControl();
            this.TabPage3 = new TabPage();
            this.Panel6 = new Panel();
            this.VSlistChiPhi = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel5 = new Panel();
            this.TxtTyGiaChoThue = new C1NumericEdit();
            this.Label22 = new Label();
            this.CmdXoaDongChiPhi = new Button();
            this.CmdThemDongChiPhi = new Button();
            this.cboLoaiTienKhaiBaoThue = new ComboBox();
            this.Label23 = new Label();
            this.Panel1 = new Panel();
            this.TxtChiPhiTruocThue = new C1NumericEdit();
            this.TxtSoTienTamUngNT = new C1NumericEdit();
            this.TxtVAT = new C1NumericEdit();
            this.TxtTongCongThueChiPhi = new C1NumericEdit();
            this.TxtSoTienNhanNT = new C1NumericEdit();
            this.TxtChiPhiNT = new C1NumericEdit();
            this.TxtConDuNT = new C1NumericEdit();
            this.TxtConDu = new C1NumericEdit();
            this.TxtChiPhi = new C1NumericEdit();
            this.TxtSoTienNhan = new C1NumericEdit();
            this.TxtSoTienTamUng = new C1NumericEdit();
            this.Label16 = new Label();
            this.Label15 = new Label();
            this.Label14 = new Label();
            this.Label20 = new Label();
            this.Label19 = new Label();
            this.Label17 = new Label();
            this.Label3 = new Label();
            this.AdvNganHang = new ADVObjects();
            this.AdvKhachHang = new ADVObjects();
            this.AdvTaiKhoan = new ADVAccount();
            this.ToolStrip1.SuspendLayout();
            this.TabControl1.SuspendLayout();
            this.TabPage1.SuspendLayout();
            ((ISupportInitialize) this.TxtTongTienTamUngNT).BeginInit();
            ((ISupportInitialize) this.TxtTongTienTamUng).BeginInit();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.TabControl2.SuspendLayout();
            this.TabPage2.SuspendLayout();
            this.Panel4.SuspendLayout();
            this.VSlistChiTietTamUng.BeginInit();
            this.Panel3.SuspendLayout();
            this.TabControl3.SuspendLayout();
            this.TabPage3.SuspendLayout();
            this.Panel6.SuspendLayout();
            this.VSlistChiPhi.BeginInit();
            this.Panel5.SuspendLayout();
            ((ISupportInitialize) this.TxtTyGiaChoThue).BeginInit();
            this.Panel1.SuspendLayout();
            ((ISupportInitialize) this.TxtChiPhiTruocThue).BeginInit();
            ((ISupportInitialize) this.TxtSoTienTamUngNT).BeginInit();
            ((ISupportInitialize) this.TxtVAT).BeginInit();
            ((ISupportInitialize) this.TxtTongCongThueChiPhi).BeginInit();
            ((ISupportInitialize) this.TxtSoTienNhanNT).BeginInit();
            ((ISupportInitialize) this.TxtChiPhiNT).BeginInit();
            ((ISupportInitialize) this.TxtConDuNT).BeginInit();
            ((ISupportInitialize) this.TxtConDu).BeginInit();
            ((ISupportInitialize) this.TxtChiPhi).BeginInit();
            ((ISupportInitialize) this.TxtSoTienNhan).BeginInit();
            ((ISupportInitialize) this.TxtSoTienTamUng).BeginInit();
            this.SuspendLayout();
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            Size size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.DropDownItems.AddRange(new ToolStripItem[] { this.PrintTH, this.PrintCT });
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x31, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.PrintTH.Name = "PrintTH";
            size = new Size(0x7e, 0x16);
            this.PrintTH.Size = size;
            this.PrintTH.Text = "Tổng hợp";
            this.PrintCT.Name = "PrintCT";
            size = new Size(0x7e, 0x16);
            this.PrintCT.Size = size;
            this.PrintCT.Text = "Chi tiết";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHelp.Alignment = ToolStripItemAlignment.Right;
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.Magenta;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x34, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "&Help";
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.CmdHelp, this.CmdXemDinhKhoan });
            Point point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x386, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdXemDinhKhoan.Image = ACCOUNTING.My.Resources.Resources.view;
            this.CmdXemDinhKhoan.ImageTransparentColor = Color.Magenta;
            this.CmdXemDinhKhoan.Name = "CmdXemDinhKhoan";
            size = new Size(0x72, 0x16);
            this.CmdXemDinhKhoan.Size = size;
            this.CmdXemDinhKhoan.Text = "Xem định khoản";
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x386, 0xb1);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 0x18;
            this.TabPage1.Controls.Add(this.AdvNganHang);
            this.TabPage1.Controls.Add(this.AdvKhachHang);
            this.TabPage1.Controls.Add(this.Label6);
            this.TabPage1.Controls.Add(this.TxtDienGiaiAnh);
            this.TabPage1.Controls.Add(this.TxtDienGiaiViet);
            this.TabPage1.Controls.Add(this.Label18);
            this.TabPage1.Controls.Add(this.Label5);
            this.TabPage1.Controls.Add(this.TxtNguoiNhan);
            this.TabPage1.Controls.Add(this.Label12);
            this.TabPage1.Controls.Add(this.Label9);
            this.TabPage1.Controls.Add(this.CboPhuongThuc);
            this.TabPage1.Controls.Add(this.CboLoaiTien);
            this.TabPage1.Controls.Add(this.TxtTongTienTamUngNT);
            this.TabPage1.Controls.Add(this.TxtTongTienTamUng);
            this.TabPage1.Controls.Add(this.txtTyGia);
            this.TabPage1.Controls.Add(this.Label4);
            this.TabPage1.Controls.Add(this.Label8);
            this.TabPage1.Controls.Add(this.Label7);
            this.TabPage1.Controls.Add(this.Label11);
            this.TabPage1.Controls.Add(this.Label10);
            this.TabPage1.Controls.Add(this.Label2);
            this.TabPage1.Controls.Add(this.AdvTaiKhoan);
            this.TabPage1.Controls.Add(this.Label13);
            this.TabPage1.Controls.Add(this.TxtNgayChungTu);
            this.TabPage1.Controls.Add(this.Label1);
            this.TabPage1.Controls.Add(this.TxtSoChungTu);
            this.TabPage1.ImageIndex = 1;
            point = new Point(4, 0x16);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            Padding padding = new Padding(3);
            this.TabPage1.Padding = padding;
            size = new Size(0x37e, 0x97);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Th\x00f4ng tin trả trước";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.Label6.AutoEllipsis = true;
            this.Label6.AutoSize = true;
            point = new Point(0x1c7, 0x27);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            this.Label6.RightToLeft = RightToLeft.No;
            size = new Size(60, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x5f;
            this.Label6.Text = "Ng\x00e2n h\x00e0ng";
            this.Label6.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x215, 0x72);
            this.TxtDienGiaiAnh.Location = point;
            this.TxtDienGiaiAnh.Name = "TxtDienGiaiAnh";
            size = new Size(0x10f, 20);
            this.TxtDienGiaiAnh.Size = size;
            this.TxtDienGiaiAnh.TabIndex = 12;
            point = new Point(0x6d, 0x72);
            this.TxtDienGiaiViet.Location = point;
            this.TxtDienGiaiViet.Name = "TxtDienGiaiViet";
            size = new Size(0x10f, 20);
            this.TxtDienGiaiViet.Size = size;
            this.TxtDienGiaiViet.TabIndex = 5;
            this.Label18.AutoEllipsis = true;
            this.Label18.AutoSize = true;
            point = new Point(0x13, 0x59);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            this.Label18.RightToLeft = RightToLeft.No;
            size = new Size(0x52, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0x5b;
            this.Label18.Text = "Người nhận tiền";
            this.Label18.TextAlign = ContentAlignment.TopRight;
            this.Label5.AutoEllipsis = true;
            this.Label5.AutoSize = true;
            point = new Point(0x13, 0x40);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = RightToLeft.No;
            size = new Size(0x38, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x5f;
            this.Label5.Text = "Người b\x00e1n";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x6d, 0x56);
            this.TxtNguoiNhan.Location = point;
            this.TxtNguoiNhan.Name = "TxtNguoiNhan";
            size = new Size(0x10f, 20);
            this.TxtNguoiNhan.Size = size;
            this.TxtNguoiNhan.TabIndex = 4;
            this.Label12.AutoEllipsis = true;
            this.Label12.AutoSize = true;
            point = new Point(0x1c7, 0x76);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            this.Label12.RightToLeft = RightToLeft.No;
            size = new Size(0x51, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x5f;
            this.Label12.Text = "Ng\x00f4n ngữ kh\x00e1c";
            this.Label12.TextAlign = ContentAlignment.TopRight;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            point = new Point(0x13, 0x76);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x45, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x5f;
            this.Label9.Text = "Diễn giải Việt";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.CboPhuongThuc.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboPhuongThuc.FormattingEnabled = true;
            point = new Point(0x6d, 8);
            this.CboPhuongThuc.Location = point;
            this.CboPhuongThuc.Name = "CboPhuongThuc";
            size = new Size(0x10f, 0x15);
            this.CboPhuongThuc.Size = size;
            this.CboPhuongThuc.TabIndex = 0;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x215, 0x3d);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x68, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 8;
            this.TxtTongTienTamUngNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongTienTamUngNT.DataType = typeof(double);
            this.TxtTongTienTamUngNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x215, 0x58);
            this.TxtTongTienTamUngNT.Location = point;
            this.TxtTongTienTamUngNT.Name = "TxtTongTienTamUngNT";
            padding = new Padding(1);
            this.TxtTongTienTamUngNT.Padding = padding;
            this.TxtTongTienTamUngNT.RightToLeft = RightToLeft.No;
            size = new Size(0x68, 20);
            this.TxtTongTienTamUngNT.Size = size;
            this.TxtTongTienTamUngNT.TabIndex = 10;
            this.TxtTongTienTamUngNT.Tag = null;
            this.TxtTongTienTamUngNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongTienTamUngNT.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtTongTienTamUngNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongTienTamUngNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongTienTamUng.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongTienTamUng.DataType = typeof(double);
            this.TxtTongTienTamUng.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2bf, 0x58);
            this.TxtTongTienTamUng.Location = point;
            this.TxtTongTienTamUng.Name = "TxtTongTienTamUng";
            padding = new Padding(1);
            this.TxtTongTienTamUng.Padding = padding;
            this.TxtTongTienTamUng.RightToLeft = RightToLeft.No;
            size = new Size(0x65, 20);
            this.TxtTongTienTamUng.Size = size;
            this.TxtTongTienTamUng.TabIndex = 11;
            this.TxtTongTienTamUng.Tag = null;
            this.TxtTongTienTamUng.TextAlign = HorizontalAlignment.Right;
            this.TxtTongTienTamUng.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtTongTienTamUng.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongTienTamUng.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2bf, 60);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            this.txtTyGia.RightToLeft = RightToLeft.No;
            size = new Size(0x65, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 9;
            this.txtTyGia.Tag = null;
            this.txtTyGia.TextAlign = HorizontalAlignment.Right;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label4.AutoSize = true;
            point = new Point(0x13, 11);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x44, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x39;
            this.Label4.Text = "Phương thức";
            this.Label4.TextAlign = ContentAlignment.TopRight;
            this.Label8.AutoSize = true;
            point = new Point(0x28f, 0x5b);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x25, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x38;
            this.Label8.Text = "Ghi sổ";
            this.Label8.TextAlign = ContentAlignment.TopRight;
            this.Label7.AutoSize = true;
            point = new Point(0x1c7, 0x5b);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x34, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x38;
            this.Label7.Text = "Giao dịch";
            this.Label7.TextAlign = ContentAlignment.TopRight;
            this.Label11.AutoSize = true;
            point = new Point(0x1c7, 0x43);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x39;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0x28f, 0x40);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 0x38;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label2.AutoSize = true;
            point = new Point(0x1c7, 11);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x47, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x25;
            this.Label2.Text = "T\x00e0i khoản C\x00f3";
            this.Label13.AutoSize = true;
            point = new Point(0xd7, 0x26);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x23;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Short;
            point = new Point(0x117, 0x23);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x65, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 2;
            this.Label1.AutoSize = true;
            point = new Point(0x13, 0x26);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x21;
            this.Label1.Text = "Số chứng từ";
            this.TxtSoChungTu.CharacterCasing = CharacterCasing.Upper;
            point = new Point(0x6d, 0x23);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x68, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 1;
            this.TabControl2.Controls.Add(this.TabPage2);
            point = new Point(0, 0xcc);
            this.TabControl2.Location = point;
            this.TabControl2.Name = "TabControl2";
            this.TabControl2.SelectedIndex = 0;
            size = new Size(0x386, 210);
            this.TabControl2.Size = size;
            this.TabControl2.TabIndex = 0x19;
            this.TabPage2.Controls.Add(this.Panel4);
            this.TabPage2.Controls.Add(this.Panel3);
            point = new Point(4, 0x16);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            padding = new Padding(3);
            this.TabPage2.Padding = padding;
            size = new Size(0x37e, 0xb8);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 0;
            this.TabPage2.Text = "Th\x00f4ng tin chi tiết trả trước";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.Panel4.Controls.Add(this.VSlistChiTietTamUng);
            this.Panel4.Dock = DockStyle.Fill;
            point = new Point(3, 3);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x378, 140);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 1;
            this.VSlistChiTietTamUng.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlistChiTietTamUng.ColumnInfo = manager.GetString("VSlistChiTietTamUng.ColumnInfo");
            this.VSlistChiTietTamUng.Dock = DockStyle.Fill;
            this.VSlistChiTietTamUng.ExtendLastCol = true;
            this.VSlistChiTietTamUng.FocusRect = FocusRectEnum.Solid;
            this.VSlistChiTietTamUng.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSlistChiTietTamUng.Location = point;
            padding = new Padding(0);
            this.VSlistChiTietTamUng.Margin = padding;
            this.VSlistChiTietTamUng.Name = "VSlistChiTietTamUng";
            this.VSlistChiTietTamUng.Rows.Count = 2;
            this.VSlistChiTietTamUng.Rows.DefaultSize = 0x11;
            this.VSlistChiTietTamUng.Rows.Fixed = 2;
            this.VSlistChiTietTamUng.Rows.MinSize = 20;
            size = new Size(0x378, 140);
            this.VSlistChiTietTamUng.Size = size;
            this.VSlistChiTietTamUng.StyleInfo = manager.GetString("VSlistChiTietTamUng.StyleInfo");
            this.VSlistChiTietTamUng.TabIndex = 0;
            this.VSlistChiTietTamUng.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.Panel3.Controls.Add(this.CmdXoaDongChiTiet);
            this.Panel3.Controls.Add(this.CmdThemDongChiTiet);
            this.Panel3.Controls.Add(this.CboLoaiKhachHang);
            this.Panel3.Controls.Add(this.Label21);
            this.Panel3.Dock = DockStyle.Bottom;
            point = new Point(3, 0x8f);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x378, 0x26);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 0;
            this.CmdXoaDongChiTiet.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdXoaDongChiTiet.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x68, 5);
            this.CmdXoaDongChiTiet.Location = point;
            this.CmdXoaDongChiTiet.Name = "CmdXoaDongChiTiet";
            size = new Size(0x5f, 0x19);
            this.CmdXoaDongChiTiet.Size = size;
            this.CmdXoaDongChiTiet.TabIndex = 0;
            this.CmdXoaDongChiTiet.Text = "X\x00f3a d\x00f2ng";
            this.CmdXoaDongChiTiet.UseVisualStyleBackColor = true;
            this.CmdThemDongChiTiet.Image = ACCOUNTING.My.Resources.Resources.Selected;
            this.CmdThemDongChiTiet.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(5, 5);
            this.CmdThemDongChiTiet.Location = point;
            this.CmdThemDongChiTiet.Name = "CmdThemDongChiTiet";
            size = new Size(0x60, 0x1a);
            this.CmdThemDongChiTiet.Size = size;
            this.CmdThemDongChiTiet.TabIndex = 1;
            this.CmdThemDongChiTiet.Text = "Th\x00eam d\x00f2ng";
            this.CmdThemDongChiTiet.UseVisualStyleBackColor = true;
            this.CboLoaiKhachHang.FormattingEnabled = true;
            point = new Point(0x12e, 6);
            this.CboLoaiKhachHang.Location = point;
            this.CboLoaiKhachHang.Name = "CboLoaiKhachHang";
            size = new Size(0x81, 0x15);
            this.CboLoaiKhachHang.Size = size;
            this.CboLoaiKhachHang.TabIndex = 0;
            this.Label21.AutoSize = true;
            point = new Point(0xd3, 10);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            size = new Size(0x4d, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0x39;
            this.Label21.Text = "Loại người b\x00e1n";
            this.Label21.TextAlign = ContentAlignment.TopRight;
            this.TabControl3.Controls.Add(this.TabPage3);
            point = new Point(3, 0x19f);
            this.TabControl3.Location = point;
            this.TabControl3.Name = "TabControl3";
            this.TabControl3.SelectedIndex = 0;
            size = new Size(0x383, 0xa6);
            this.TabControl3.Size = size;
            this.TabControl3.TabIndex = 0x1a;
            this.TabPage3.Controls.Add(this.Panel6);
            this.TabPage3.Controls.Add(this.Panel5);
            point = new Point(4, 0x16);
            this.TabPage3.Location = point;
            this.TabPage3.Name = "TabPage3";
            padding = new Padding(3);
            this.TabPage3.Padding = padding;
            size = new Size(0x37b, 140);
            this.TabPage3.Size = size;
            this.TabPage3.TabIndex = 0;
            this.TabPage3.Text = "Th\x00f4ng tin chi  ph\x00ed";
            this.TabPage3.UseVisualStyleBackColor = true;
            this.Panel6.Controls.Add(this.VSlistChiPhi);
            this.Panel6.Dock = DockStyle.Fill;
            point = new Point(3, 3);
            this.Panel6.Location = point;
            this.Panel6.Name = "Panel6";
            size = new Size(0x375, 0x62);
            this.Panel6.Size = size;
            this.Panel6.TabIndex = 1;
            this.VSlistChiPhi.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlistChiPhi.ColumnInfo = manager.GetString("VSlistChiPhi.ColumnInfo");
            this.VSlistChiPhi.Dock = DockStyle.Fill;
            this.VSlistChiPhi.ExtendLastCol = true;
            this.VSlistChiPhi.FocusRect = FocusRectEnum.Solid;
            this.VSlistChiPhi.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSlistChiPhi.Location = point;
            padding = new Padding(0);
            this.VSlistChiPhi.Margin = padding;
            this.VSlistChiPhi.Name = "VSlistChiPhi";
            this.VSlistChiPhi.Rows.Count = 2;
            this.VSlistChiPhi.Rows.DefaultSize = 0x11;
            this.VSlistChiPhi.Rows.Fixed = 2;
            this.VSlistChiPhi.Rows.MinSize = 20;
            size = new Size(0x375, 0x62);
            this.VSlistChiPhi.Size = size;
            this.VSlistChiPhi.StyleInfo = manager.GetString("VSlistChiPhi.StyleInfo");
            this.VSlistChiPhi.TabIndex = 0x3a;
            this.VSlistChiPhi.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.Panel5.Controls.Add(this.TxtTyGiaChoThue);
            this.Panel5.Controls.Add(this.Label22);
            this.Panel5.Controls.Add(this.CmdXoaDongChiPhi);
            this.Panel5.Controls.Add(this.CmdThemDongChiPhi);
            this.Panel5.Controls.Add(this.cboLoaiTienKhaiBaoThue);
            this.Panel5.Controls.Add(this.Label23);
            this.Panel5.Dock = DockStyle.Bottom;
            point = new Point(3, 0x65);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0x375, 0x24);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.TxtTyGiaChoThue.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTyGiaChoThue.DataType = typeof(double);
            this.TxtTyGiaChoThue.FormatType = FormatTypeEnum.Currency;
            point = new Point(460, 9);
            this.TxtTyGiaChoThue.Location = point;
            this.TxtTyGiaChoThue.Name = "TxtTyGiaChoThue";
            padding = new Padding(1);
            this.TxtTyGiaChoThue.Padding = padding;
            size = new Size(0x65, 20);
            this.TxtTyGiaChoThue.Size = size;
            this.TxtTyGiaChoThue.TabIndex = 2;
            this.TxtTyGiaChoThue.Tag = null;
            this.TxtTyGiaChoThue.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtTyGiaChoThue.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTyGiaChoThue.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label22.AutoSize = true;
            point = new Point(0x175, 12);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            size = new Size(0x51, 13);
            this.Label22.Size = size;
            this.Label22.TabIndex = 0x3a;
            this.Label22.Text = "Tỷ gi\x00e1 cho thuế";
            this.Label22.TextAlign = ContentAlignment.TopRight;
            this.CmdXoaDongChiPhi.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdXoaDongChiPhi.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x69, 5);
            this.CmdXoaDongChiPhi.Location = point;
            this.CmdXoaDongChiPhi.Name = "CmdXoaDongChiPhi";
            size = new Size(0x61, 0x1a);
            this.CmdXoaDongChiPhi.Size = size;
            this.CmdXoaDongChiPhi.TabIndex = 2;
            this.CmdXoaDongChiPhi.Text = "X\x00f3a d\x00f2ng";
            this.CmdXoaDongChiPhi.UseVisualStyleBackColor = true;
            this.CmdThemDongChiPhi.Image = ACCOUNTING.My.Resources.Resources.Selected;
            this.CmdThemDongChiPhi.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(4, 6);
            this.CmdThemDongChiPhi.Location = point;
            this.CmdThemDongChiPhi.Name = "CmdThemDongChiPhi";
            size = new Size(0x61, 0x1a);
            this.CmdThemDongChiPhi.Size = size;
            this.CmdThemDongChiPhi.TabIndex = 0;
            this.CmdThemDongChiPhi.Text = "Th\x00eam d\x00f2ng";
            this.CmdThemDongChiPhi.UseVisualStyleBackColor = true;
            this.cboLoaiTienKhaiBaoThue.FormattingEnabled = true;
            point = new Point(0x107, 8);
            this.cboLoaiTienKhaiBaoThue.Location = point;
            this.cboLoaiTienKhaiBaoThue.Name = "cboLoaiTienKhaiBaoThue";
            size = new Size(0x68, 0x15);
            this.cboLoaiTienKhaiBaoThue.Size = size;
            this.cboLoaiTienKhaiBaoThue.TabIndex = 1;
            this.Label23.AutoSize = true;
            point = new Point(210, 11);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            size = new Size(0x2f, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x39;
            this.Label23.Text = "Loại tiền";
            this.Label23.TextAlign = ContentAlignment.TopRight;
            this.Panel1.Controls.Add(this.TxtChiPhiTruocThue);
            this.Panel1.Controls.Add(this.TxtSoTienTamUngNT);
            this.Panel1.Controls.Add(this.TxtVAT);
            this.Panel1.Controls.Add(this.TxtTongCongThueChiPhi);
            this.Panel1.Controls.Add(this.TxtSoTienNhanNT);
            this.Panel1.Controls.Add(this.TxtChiPhiNT);
            this.Panel1.Controls.Add(this.TxtConDuNT);
            this.Panel1.Controls.Add(this.TxtConDu);
            this.Panel1.Controls.Add(this.TxtChiPhi);
            this.Panel1.Controls.Add(this.TxtSoTienNhan);
            this.Panel1.Controls.Add(this.TxtSoTienTamUng);
            this.Panel1.Controls.Add(this.Label16);
            this.Panel1.Controls.Add(this.Label15);
            this.Panel1.Controls.Add(this.Label14);
            this.Panel1.Controls.Add(this.Label20);
            this.Panel1.Controls.Add(this.Label19);
            this.Panel1.Controls.Add(this.Label17);
            this.Panel1.Controls.Add(this.Label3);
            this.Panel1.Dock = DockStyle.Bottom;
            point = new Point(0, 0x245);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x386, 0x6d);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x1b;
            this.TxtChiPhiTruocThue.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChiPhiTruocThue.DataType = typeof(double);
            this.TxtChiPhiTruocThue.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2ed, 6);
            this.TxtChiPhiTruocThue.Location = point;
            this.TxtChiPhiTruocThue.Name = "TxtChiPhiTruocThue";
            padding = new Padding(1);
            this.TxtChiPhiTruocThue.Padding = padding;
            this.TxtChiPhiTruocThue.ReadOnly = true;
            this.TxtChiPhiTruocThue.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtChiPhiTruocThue.Size = size;
            this.TxtChiPhiTruocThue.TabIndex = 5;
            this.TxtChiPhiTruocThue.Tag = null;
            this.TxtChiPhiTruocThue.TextAlign = HorizontalAlignment.Right;
            this.TxtChiPhiTruocThue.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChiPhiTruocThue.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChiPhiTruocThue.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienTamUngNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienTamUngNT.DataType = typeof(double);
            this.TxtSoTienTamUngNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x16a, 6);
            this.TxtSoTienTamUngNT.Location = point;
            this.TxtSoTienTamUngNT.Name = "TxtSoTienTamUngNT";
            padding = new Padding(1);
            this.TxtSoTienTamUngNT.Padding = padding;
            this.TxtSoTienTamUngNT.ReadOnly = true;
            this.TxtSoTienTamUngNT.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtSoTienTamUngNT.Size = size;
            this.TxtSoTienTamUngNT.TabIndex = 5;
            this.TxtSoTienTamUngNT.Tag = null;
            this.TxtSoTienTamUngNT.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienTamUngNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienTamUngNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienTamUngNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtVAT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtVAT.DataType = typeof(double);
            this.TxtVAT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2ed, 0x20);
            this.TxtVAT.Location = point;
            this.TxtVAT.Name = "TxtVAT";
            padding = new Padding(1);
            this.TxtVAT.Padding = padding;
            this.TxtVAT.ReadOnly = true;
            this.TxtVAT.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtVAT.Size = size;
            this.TxtVAT.TabIndex = 5;
            this.TxtVAT.Tag = null;
            this.TxtVAT.TextAlign = HorizontalAlignment.Right;
            this.TxtVAT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtVAT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtVAT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCongThueChiPhi.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongCongThueChiPhi.DataType = typeof(double);
            this.TxtTongCongThueChiPhi.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2ed, 0x3d);
            this.TxtTongCongThueChiPhi.Location = point;
            this.TxtTongCongThueChiPhi.Name = "TxtTongCongThueChiPhi";
            padding = new Padding(1);
            this.TxtTongCongThueChiPhi.Padding = padding;
            this.TxtTongCongThueChiPhi.ReadOnly = true;
            this.TxtTongCongThueChiPhi.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtTongCongThueChiPhi.Size = size;
            this.TxtTongCongThueChiPhi.TabIndex = 5;
            this.TxtTongCongThueChiPhi.Tag = null;
            this.TxtTongCongThueChiPhi.TextAlign = HorizontalAlignment.Right;
            this.TxtTongCongThueChiPhi.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongCongThueChiPhi.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCongThueChiPhi.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNhanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienNhanNT.DataType = typeof(double);
            this.TxtSoTienNhanNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x16a, 0x20);
            this.TxtSoTienNhanNT.Location = point;
            this.TxtSoTienNhanNT.Name = "TxtSoTienNhanNT";
            padding = new Padding(1);
            this.TxtSoTienNhanNT.Padding = padding;
            this.TxtSoTienNhanNT.ReadOnly = true;
            this.TxtSoTienNhanNT.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtSoTienNhanNT.Size = size;
            this.TxtSoTienNhanNT.TabIndex = 5;
            this.TxtSoTienNhanNT.Tag = null;
            this.TxtSoTienNhanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienNhanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienNhanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNhanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChiPhiNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChiPhiNT.DataType = typeof(double);
            this.TxtChiPhiNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x16a, 0x3a);
            this.TxtChiPhiNT.Location = point;
            this.TxtChiPhiNT.Name = "TxtChiPhiNT";
            padding = new Padding(1);
            this.TxtChiPhiNT.Padding = padding;
            this.TxtChiPhiNT.ReadOnly = true;
            this.TxtChiPhiNT.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtChiPhiNT.Size = size;
            this.TxtChiPhiNT.TabIndex = 5;
            this.TxtChiPhiNT.Tag = null;
            this.TxtChiPhiNT.TextAlign = HorizontalAlignment.Right;
            this.TxtChiPhiNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChiPhiNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChiPhiNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtConDuNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtConDuNT.DataType = typeof(double);
            this.TxtConDuNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x16a, 0x54);
            this.TxtConDuNT.Location = point;
            this.TxtConDuNT.Name = "TxtConDuNT";
            padding = new Padding(1);
            this.TxtConDuNT.Padding = padding;
            this.TxtConDuNT.ReadOnly = true;
            this.TxtConDuNT.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtConDuNT.Size = size;
            this.TxtConDuNT.TabIndex = 5;
            this.TxtConDuNT.Tag = null;
            this.TxtConDuNT.TextAlign = HorizontalAlignment.Right;
            this.TxtConDuNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtConDuNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtConDuNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtConDu.BorderStyle = BorderStyle.FixedSingle;
            this.TxtConDu.DataType = typeof(double);
            this.TxtConDu.FormatType = FormatTypeEnum.Currency;
            point = new Point(510, 0x54);
            this.TxtConDu.Location = point;
            this.TxtConDu.Name = "TxtConDu";
            padding = new Padding(1);
            this.TxtConDu.Padding = padding;
            this.TxtConDu.ReadOnly = true;
            this.TxtConDu.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtConDu.Size = size;
            this.TxtConDu.TabIndex = 5;
            this.TxtConDu.Tag = null;
            this.TxtConDu.TextAlign = HorizontalAlignment.Right;
            this.TxtConDu.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtConDu.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtConDu.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChiPhi.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChiPhi.DataType = typeof(double);
            this.TxtChiPhi.FormatType = FormatTypeEnum.Currency;
            point = new Point(510, 0x3a);
            this.TxtChiPhi.Location = point;
            this.TxtChiPhi.Name = "TxtChiPhi";
            padding = new Padding(1);
            this.TxtChiPhi.Padding = padding;
            this.TxtChiPhi.ReadOnly = true;
            this.TxtChiPhi.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtChiPhi.Size = size;
            this.TxtChiPhi.TabIndex = 5;
            this.TxtChiPhi.Tag = null;
            this.TxtChiPhi.TextAlign = HorizontalAlignment.Right;
            this.TxtChiPhi.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChiPhi.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChiPhi.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNhan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienNhan.DataType = typeof(double);
            this.TxtSoTienNhan.FormatType = FormatTypeEnum.Currency;
            point = new Point(510, 0x20);
            this.TxtSoTienNhan.Location = point;
            this.TxtSoTienNhan.Name = "TxtSoTienNhan";
            padding = new Padding(1);
            this.TxtSoTienNhan.Padding = padding;
            this.TxtSoTienNhan.ReadOnly = true;
            this.TxtSoTienNhan.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtSoTienNhan.Size = size;
            this.TxtSoTienNhan.TabIndex = 5;
            this.TxtSoTienNhan.Tag = null;
            this.TxtSoTienNhan.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienNhan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienNhan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNhan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienTamUng.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienTamUng.DataType = typeof(double);
            this.TxtSoTienTamUng.FormatType = FormatTypeEnum.Currency;
            point = new Point(510, 6);
            this.TxtSoTienTamUng.Location = point;
            this.TxtSoTienTamUng.Name = "TxtSoTienTamUng";
            padding = new Padding(1);
            this.TxtSoTienTamUng.Padding = padding;
            this.TxtSoTienTamUng.ReadOnly = true;
            this.TxtSoTienTamUng.RightToLeft = RightToLeft.No;
            size = new Size(0x8e, 20);
            this.TxtSoTienTamUng.Size = size;
            this.TxtSoTienTamUng.TabIndex = 5;
            this.TxtSoTienTamUng.Tag = null;
            this.TxtSoTienTamUng.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienTamUng.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienTamUng.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienTamUng.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label16.AutoSize = true;
            point = new Point(0x127, 0x57);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            size = new Size(0x3d, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0;
            this.Label16.Text = "Ch\x00eanh lệch";
            this.Label15.AutoSize = true;
            point = new Point(0xff, 0x3e);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            size = new Size(0x65, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0;
            this.Label15.Text = "Ph\x00ed ng\x00e2n h\x00e0ng (Nợ)";
            this.Label14.AutoSize = true;
            point = new Point(0x10f, 0x24);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            size = new Size(0x55, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 0;
            this.Label14.Text = "Số trả trước (Nợ)";
            this.Label20.AutoSize = true;
            point = new Point(0x2ab, 0x3f);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            size = new Size(0x3b, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 0;
            this.Label20.Text = "Tổng cộng";
            this.Label19.AutoSize = true;
            point = new Point(0x2ae, 0x25);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x38, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 0;
            this.Label19.Text = "Thuế VAT";
            this.Label17.AutoSize = true;
            point = new Point(0x297, 10);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            size = new Size(0x4f, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 0;
            this.Label17.Text = "Tiền trước thuế";
            this.Label3.AutoSize = true;
            point = new Point(0xff, 10);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x65, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0;
            this.Label3.Text = "Số tiền thực trả (C\x00f3)";
            this.AdvNganHang.Conditions = "";
            this.AdvNganHang.LoaiDoiTuong = modGeneral.TypeObjects.NganHang;
            point = new Point(0x215, 0x23);
            this.AdvNganHang.Location = point;
            this.AdvNganHang.Name = "AdvNganHang";
            this.AdvNganHang.ReadOnly = false;
            size = new Size(0x10f, 20);
            this.AdvNganHang.Size = size;
            this.AdvNganHang.TabIndex = 7;
            this.AdvNganHang.UpperText = true;
            this.AdvNganHang.Value = "";
            this.AdvNganHang.WidthCode = 80;
            this.AdvKhachHang.Conditions = "";
            this.AdvKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.NhaCungCap;
            point = new Point(0x6d, 0x3d);
            this.AdvKhachHang.Location = point;
            this.AdvKhachHang.Name = "AdvKhachHang";
            this.AdvKhachHang.ReadOnly = false;
            size = new Size(0x10f, 20);
            this.AdvKhachHang.Size = size;
            this.AdvKhachHang.TabIndex = 3;
            this.AdvKhachHang.UpperText = true;
            this.AdvKhachHang.Value = "";
            this.AdvKhachHang.WidthCode = 80;
            this.AdvTaiKhoan.Conditions = "";
            this.AdvTaiKhoan.DefaultValue = "";
            this.AdvTaiKhoan.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoan.KeyFilter = "111";
            point = new Point(0x215, 8);
            this.AdvTaiKhoan.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoan.Margin = padding;
            this.AdvTaiKhoan.Name = "AdvTaiKhoan";
            this.AdvTaiKhoan.OnlyDigit = false;
            this.AdvTaiKhoan.ReadOnly = false;
            size = new Size(0x10f, 20);
            this.AdvTaiKhoan.Size = size;
            this.AdvTaiKhoan.TabIndex = 6;
            this.AdvTaiKhoan.UpperText = true;
            this.AdvTaiKhoan.Value = "";
            this.AdvTaiKhoan.WithCode = 80;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x386, 690);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.TabControl3);
            this.Controls.Add(this.TabControl2);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.KeyPreview = true;
            this.Name = "Frm_TraTruocNguoiBan";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "TRA TRUOC NGUOI BAN";
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.TabControl1.ResumeLayout(false);
            this.TabPage1.ResumeLayout(false);
            this.TabPage1.PerformLayout();
            ((ISupportInitialize) this.TxtTongTienTamUngNT).EndInit();
            ((ISupportInitialize) this.TxtTongTienTamUng).EndInit();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.TabControl2.ResumeLayout(false);
            this.TabPage2.ResumeLayout(false);
            this.Panel4.ResumeLayout(false);
            this.VSlistChiTietTamUng.EndInit();
            this.Panel3.ResumeLayout(false);
            this.Panel3.PerformLayout();
            this.TabControl3.ResumeLayout(false);
            this.TabPage3.ResumeLayout(false);
            this.Panel6.ResumeLayout(false);
            this.VSlistChiPhi.EndInit();
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            ((ISupportInitialize) this.TxtTyGiaChoThue).EndInit();
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            ((ISupportInitialize) this.TxtChiPhiTruocThue).EndInit();
            ((ISupportInitialize) this.TxtSoTienTamUngNT).EndInit();
            ((ISupportInitialize) this.TxtVAT).EndInit();
            ((ISupportInitialize) this.TxtTongCongThueChiPhi).EndInit();
            ((ISupportInitialize) this.TxtSoTienNhanNT).EndInit();
            ((ISupportInitialize) this.TxtChiPhiNT).EndInit();
            ((ISupportInitialize) this.TxtConDuNT).EndInit();
            ((ISupportInitialize) this.TxtConDu).EndInit();
            ((ISupportInitialize) this.TxtChiPhi).EndInit();
            ((ISupportInitialize) this.TxtSoTienNhan).EndInit();
            ((ISupportInitialize) this.TxtSoTienTamUng).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void MergCell()
        {
            this.VSlistChiTietTamUng.AllowMerging = AllowMergingEnum.FixedOnly;
            this.VSlistChiTietTamUng.Rows[0].AllowMerging = true;
            this.VSlistChiTietTamUng.Cols[6].AllowMerging = true;
            this.VSlistChiTietTamUng.Cols[7].AllowMerging = true;
            this.VSlistChiTietTamUng[1, 1] = "Số";
            this.VSlistChiTietTamUng[1, 2] = "Ng\x00e0y";
            this.VSlistChiTietTamUng[1, 4] = "Số t\x00e0i khoản";
            this.VSlistChiTietTamUng[1, 6] = "Loại tiền";
            this.VSlistChiTietTamUng[1, 7] = "Tỷ gi\x00e1";
            this.VSlistChiTietTamUng[1, 8] = "Giao dịch";
            this.VSlistChiTietTamUng[1, 9] = "Ghi sổ";
            this.VSlistChiTietTamUng[1, 10] = "Giao dịch";
            this.VSlistChiTietTamUng[1, 11] = "Ghi sổ";
            this.VSlistChiTietTamUng[1, 12] = "Tiếng việt";
            this.VSlistChiTietTamUng[1, 13] = "Nước ngo\x00e0i";
            this.VSlistChiPhi.AllowMerging = AllowMergingEnum.FixedOnly;
            this.VSlistChiPhi.Rows[0].AllowMerging = true;
            this.VSlistChiPhi.Cols[10].AllowMerging = true;
            this.VSlistChiPhi.Cols[11].AllowMerging = true;
            this.VSlistChiPhi.Cols[14].AllowMerging = true;
            this.VSlistChiPhi[1, 1] = "Số";
            this.VSlistChiPhi[1, 2] = "Ng\x00e0y";
            this.VSlistChiPhi[1, 4] = "Số t\x00e0i khoản";
            this.VSlistChiPhi[1, 5] = "T\x00ean t\x00e0i khoản";
            this.VSlistChiPhi[1, 7] = "M\x00e3 ng\x00e2n h\x00e0ng";
            this.VSlistChiPhi[1, 8] = "T\x00ean ng\x00e2n h\x00e0ng";
            this.VSlistChiPhi[1, 10] = "Loại tiền";
            this.VSlistChiPhi[1, 11] = "Tỷ gi\x00e1";
            this.VSlistChiPhi[1, 12] = "Giao dịch";
            this.VSlistChiPhi[1, 13] = "Ghi sổ";
            this.VSlistChiPhi[1, 14] = "%VAT";
            this.VSlistChiPhi[1, 15] = "Giao dịch";
            this.VSlistChiPhi[1, 0x10] = "Ghi sổ";
            this.VSlistChiPhi[1, 0x11] = "Giao dịch";
            this.VSlistChiPhi[1, 0x12] = "Ghi sổ";
            this.VSlistChiPhi[1, 0x13] = "Tiếng việt";
            this.VSlistChiPhi[1, 20] = "Nước ngo\x00e0i";
        }

        public bool SaveDetailsTemp()
        {
            int num2 = this.VSlistChiTietTamUng.Rows.Count - 1;
            for (int i = 2; i <= num2; i++)
            {
                clsTamUngNhaCungCapChiTiet objTUNCCCT = this.objTUNCCCT;
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.VSlistChiTietTamUng[i, 0] = modGeneral.CreatKey("GL_TamUngNhaCungCapChiTiet", 15, "TU");
                }
                objTUNCCCT.Khoa = Conversions.ToString(this.VSlistChiTietTamUng[i, 0]);
                objTUNCCCT.KhoaTamUng = this.cFrmKhoa;
                objTUNCCCT.SoChungTu = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString();
                objTUNCCCT.NgayChungTu = LVYModule.Date2Char(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 2]), "", modGeneral.TypeOfValue.Nothing)));
                objTUNCCCT.KhoaTaiKhoanNo = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 3]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.KhoaLoaiTien = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 5]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 7]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.SoTien = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 8]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.SoTienGhiSo = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 9]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.SoTienThuc = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 10]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.SoTienThucGhiSo = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 11]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.DienGiaiViet = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 12]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.DienGiaiAnh = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[i, 13]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.KhoaDoiTuongCo = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvNganHang.Value, "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.KhoaTaiKhoanCo = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvTaiKhoan.Value, "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.KhoaDoiTuongNo = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCT.KhoaDonVi = Conversions.ToString(LVYModule.ReturnIfNull(modGeneral.H_CLIENT, "", modGeneral.TypeOfValue.Nothing));
                if (!objTUNCCCT.Save())
                {
                    return false;
                }
                objTUNCCCT = null;
            }
            return true;
        }

        public bool SaveDetailsTempChiPhi()
        {
            int num2 = this.VSlistChiPhi.Rows.Count - 1;
            for (int i = 2; i <= num2; i++)
            {
                clsTamUngNhaCungCapChiTietChiPhi objTUNCCCTCP = this.objTUNCCCTCP;
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.VSlistChiPhi[i, 0] = modGeneral.CreatKey("GL_TamUngNhaCungCapChiTietChiPhi", 15, "TU");
                }
                objTUNCCCTCP.Khoa = Conversions.ToString(this.VSlistChiPhi[i, 0]);
                objTUNCCCTCP.KhoaTamUng = this.cFrmKhoa;
                objTUNCCCTCP.SoChungTu = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString();
                objTUNCCCTCP.NgayChungTu = LVYModule.Date2Char(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 2]), "", modGeneral.TypeOfValue.Nothing)));
                objTUNCCCTCP.KhoaTaiKhoanNo = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 3]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.KhoaDoiTuong = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 6]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.KhoaLoaiTien = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 9]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.TyGia = Conversions.ToString(Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 11]), 0, modGeneral.TypeOfValue.Nothing)));
                objTUNCCCTCP.SoTien = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.SoTienGhiSo = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 13]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.ThueSuat = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.TienThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.TienThueGhiSo = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.TienThueKhauTru = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.TienThueKhauTruGhiSo = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.DienGiaiViet = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x13]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.DienGiaiAnh = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 20]), "", modGeneral.TypeOfValue.Nothing));
                clsDMTaiKhoan khoan = new clsDMTaiKhoan();
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.CboLoaiKhachHang.SelectedValue, "TN", false))
                {
                    khoan.LoadByCode("3310");
                }
                else
                {
                    khoan.LoadByCode("3310");
                }
                objTUNCCCTCP.KhoaTaiKhoanCo = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvTaiKhoan.Value, "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.KhoaDoiTuongCo = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvNganHang.Value, "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.KhoaDoiTuongThue = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 30]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.TenDoiTuongThue = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x1a]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.MaSoThue = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x1b]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.DiaChiThue = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x1c]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.SoHoaDon = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x18]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.NgayHoaDon = LVYModule.Date2Char(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x19]), "", modGeneral.TypeOfValue.Nothing)));
                objTUNCCCTCP.SoSeri = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x17]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.KhoaPhuongThucThue = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x16]), "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.Flag = Conversions.ToInteger(this.VSlistChiPhi[i, 0x15]);
                objTUNCCCTCP.KhoaDonVi = Conversions.ToString(LVYModule.ReturnIfNull(modGeneral.H_CLIENT, "", modGeneral.TypeOfValue.Nothing));
                objTUNCCCTCP.DienGiaiMatHang = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[i, 0x1d]), "", modGeneral.TypeOfValue.Nothing));
                if (!objTUNCCCTCP.Save())
                {
                    return false;
                }
                objTUNCCCTCP = null;
            }
            return true;
        }

        public void ShowData(string strKhoa)
        {
            if (this.objTUNCC.Load(strKhoa))
            {
                clsTamUngNhaCungCap objTUNCC = this.objTUNCC;
                this.cFrmKhoa = objTUNCC.Khoa;
                this.CboPhuongThuc.SelectedValue = objTUNCC.KhoaPhuongThucTamUng;
                this.TxtSoChungTu.Text = objTUNCC.SoChungTu;
                this.TxtNgayChungTu.Text = LVYModule.Char2Date(objTUNCC.NgayChungTu);
                this.AdvKhachHang.Value = objTUNCC.KhoaNhaCungCap;
                this.TxtNguoiNhan.Text = objTUNCC.NguoiNhan;
                this.TxtDienGiaiViet.Text = objTUNCC.DienGiaiViet;
                this.AdvTaiKhoan.Value = objTUNCC.KhoaTaiKhoanCo;
                this.AdvNganHang.Value = objTUNCC.KhoaDoiTuongCo;
                this.CboLoaiTien.SelectedValue = objTUNCC.KhoaLoaiTien;
                this.txtTyGia.Value = objTUNCC.TyGia;
                this.TxtTongTienTamUngNT.Value = objTUNCC.SoTienTamUngNT;
                this.TxtTongTienTamUng.Value = objTUNCC.SoTienTamUng;
                this.TxtDienGiaiAnh.Text = objTUNCC.DienGiaiAnh;
                if (objTUNCC.NguonNhap == "TN")
                {
                    this.CboLoaiKhachHang.SelectedValue = "TN";
                }
                else
                {
                    this.CboLoaiKhachHang.SelectedValue = "NN";
                }
                objTUNCC = null;
                this.VSlistChiTietTamUng.Rows.Count = 2;
                DataTable listTamUngNhaCungCapChiTiet = this.objTUNCCCT.GetListTamUngNhaCungCapChiTiet(this.objTUNCC.Khoa);
                if (listTamUngNhaCungCapChiTiet != null)
                {
                    int num;
                    int num2 = listTamUngNhaCungCapChiTiet.Rows.Count - 1;
                    for (num = 0; num <= num2; num++)
                    {
                        C1.Win.C1FlexGrid.C1FlexGrid vSlistChiTietTamUng = this.VSlistChiTietTamUng;
                        vSlistChiTietTamUng.AddItem("");
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["Khoa"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoChungTu"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 2] = LVYModule.Char2Date(listTamUngNhaCungCapChiTiet.Rows[num]["NgayChungTu"].ToString());
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["KhoaTK"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTaiKhoan"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["Ma"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TenLoaiTien"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TyGia"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTien"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTienGhiSO"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTienThuc"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTienThucGhiSo"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["DienGiaiViet"]);
                        vSlistChiTietTamUng[vSlistChiTietTamUng.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["DienGiaiAnh"]);
                        vSlistChiTietTamUng = null;
                    }
                    this.VSlistChiPhi.Rows.Count = 2;
                    listTamUngNhaCungCapChiTiet = this.objTUNCCCTCP.GetListTamUngNhaCungCapChiPhi(this.objTUNCC.Khoa);
                    if (listTamUngNhaCungCapChiTiet != null)
                    {
                        int num3 = listTamUngNhaCungCapChiTiet.Rows.Count - 1;
                        for (num = 0; num <= num3; num++)
                        {
                            C1.Win.C1FlexGrid.C1FlexGrid vSlistChiPhi = this.VSlistChiPhi;
                            vSlistChiPhi.AddItem("");
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["Khoa"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoChungTu"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 2] = LVYModule.Char2Date(listTamUngNhaCungCapChiTiet.Rows[num]["NgayChungTu"].ToString());
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["KhoaTaiKhoanNo"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTaiKhoan"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TenTaiKhoan"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["KhoaDoiTuong"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["MaDoiTuong"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TenDoiTuong"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["Ma"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TenLoaiTien"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TyGia"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTien"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoTienGhiSo"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["ThueSuat"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TienThue"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TienThueGhiSo"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TienThueKhauTru"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TienThueKhauTruGhiSo"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["DienGiaiViet"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["DienGiaiAnh"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["Flag"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x16] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["KhoaPhuongThucThue"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x17] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoSeri"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x18] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["SoHoaDon"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x19] = LVYModule.Char2Date(Conversions.ToString(listTamUngNhaCungCapChiTiet.Rows[num]["NgayHoaDon"]));
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x1a] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["TenDoiTuongThue"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x1b] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["MaSoThue"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x1c] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["DiaChiThue"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 0x1d] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["DienGiaiMatHang"]);
                            vSlistChiPhi[vSlistChiPhi.Rows.Count - 1, 30] = RuntimeHelpers.GetObjectValue(listTamUngNhaCungCapChiTiet.Rows[num]["KhoaDoiTuongThue"]);
                            vSlistChiPhi = null;
                        }
                    }
                }
            }
        }

        public void TinhTong()
        {
            double num = 0.0;
            try
            {
                num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.TxtSoTienTamUngNT.Value = RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value);
                this.TxtSoTienTamUng.Value = RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUng.Value);
                this.TxtSoTienNhanNT.Value = LVYModule.SumColGrid(this.VSlistChiTietTamUng, 10);
                this.TxtSoTienNhan.Value = LVYModule.SumColGrid(this.VSlistChiTietTamUng, 11);
                this.TxtChiPhiNT.Value = LVYModule.SumColGrid(this.VSlistChiPhi, 12) + LVYModule.SumColGrid(this.VSlistChiPhi, 0x11);
                this.TxtChiPhi.Value = LVYModule.SumColGrid(this.VSlistChiPhi, 13) + LVYModule.SumColGrid(this.VSlistChiPhi, 0x12);
                this.TxtConDuNT.Value = Microsoft.VisualBasic.CompilerServices.Operators.SubtractObject(this.TxtSoTienTamUngNT.Value, Microsoft.VisualBasic.CompilerServices.Operators.AddObject(this.TxtSoTienNhanNT.Value, this.TxtChiPhiNT.Value));
                this.TxtConDu.Value = Microsoft.VisualBasic.CompilerServices.Operators.SubtractObject(this.TxtSoTienTamUng.Value, Microsoft.VisualBasic.CompilerServices.Operators.AddObject(this.TxtSoTienNhan.Value, this.TxtChiPhi.Value));
                this.TxtChiPhiTruocThue.Value = LVYModule.SumColGrid(this.VSlistChiPhi, 13);
                this.TxtVAT.Value = LVYModule.SumColGrid(this.VSlistChiPhi, 0x12);
                this.TxtTongCongThueChiPhi.Value = Microsoft.VisualBasic.CompilerServices.Operators.AddObject(this.TxtChiPhiTruocThue.Value, this.TxtVAT.Value);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void TxtDienGiaiAnh_TextChanged(object sender, EventArgs e)
        {
            try
            {
                int num2 = this.VSlistChiTietTamUng.Rows.Count - 1;
                for (int i = 2; i <= num2; i++)
                {
                    this.VSlistChiTietTamUng[i, 13] = this.TxtDienGiaiAnh.Text.ToString();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void TxtDienGiaiViet_TextChanged(object sender, EventArgs e)
        {
            try
            {
                int num2 = this.VSlistChiTietTamUng.Rows.Count - 1;
                for (int i = 2; i <= num2; i++)
                {
                    this.VSlistChiTietTamUng[i, 12] = this.TxtDienGiaiAnh.Text.ToString();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void TxtSoChungTu_TextChanged(object sender, EventArgs e)
        {
        }

        private void TxtTongTienTamUngNT_LostFocus(object sender, EventArgs e)
        {
            double num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            double num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTongTienTamUng.Value = num * num2;
        }

        private void TxtTongTienTamUngNT_TextChanged(object sender, EventArgs e)
        {
            try
            {
                this.TxtTongTienTamUng.Value = Conversions.ToDouble(this.TxtTongTienTamUngNT.Value) * Conversions.ToDouble(this.txtTyGia.Value);
                this.TinhTong();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void TxtTongTienTamUngNT_ValueChanged(object sender, EventArgs e)
        {
            try
            {
                this.TxtTongTienTamUng.Value = Conversions.ToDouble(this.TxtTongTienTamUngNT.Value) * Conversions.ToDouble(this.txtTyGia.Value);
                this.TinhTong();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void txtTyGia_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if ((this.TxtTongTienTamUngNT.Text.ToString().Trim() != "") & Conversions.ToBoolean(this.txtTyGia.Text.ToString().Trim()))
                {
                    double num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
                    double num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                    this.TxtTongTienTamUng.Value = num3 * num2;
                    this.TxtTyGiaChoThue.Value = RuntimeHelpers.GetObjectValue(this.txtTyGia.Value);
                }
                int num4 = this.VSlistChiTietTamUng.Rows.Count - 1;
                for (int i = 2; i <= num4; i++)
                {
                    this.VSlistChiTietTamUng[i, 5] = this.CboLoaiTien.SelectedValue.ToString();
                    this.VSlistChiTietTamUng[i, 6] = this.CboLoaiTien.Text.ToString();
                    this.VSlistChiTietTamUng[i, 7] = this.txtTyGia.Text.ToString();
                    RowColEventArgs args = new RowColEventArgs(i, 8);
                    this.VSlistChiTietTamUng_AfterEdit(this, args);
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void TxtTyGiaChoThue_TextChanged(object sender, EventArgs e)
        {
            try
            {
                int num2 = this.VSlistChiPhi.Rows.Count - 1;
                for (int i = 2; i <= num2; i++)
                {
                    this.VSlistChiPhi[i, 11] = this.TxtTyGiaChoThue.Value.ToString();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        public bool UpdateData()
        {
            bool flag=false;
            clsTamUngNhaCungCap objTUNCC = this.objTUNCC;
            objTUNCC.Khoa = this.cFrmKhoa;
            objTUNCC.KhoaPhuongThucTamUng = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboPhuongThuc.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
            objTUNCC.NguonNhap = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiKhachHang.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
            objTUNCC.SoChungTu = this.TxtSoChungTu.Text;
            objTUNCC.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objTUNCC.KhoaNhaCungCap = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing));
            objTUNCC.KhoaDoiTuongCo = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvNganHang.Value, "", modGeneral.TypeOfValue.Nothing));
            objTUNCC.NguoiNhan = this.TxtNguoiNhan.Text;
            objTUNCC.KhoaTaiKhoanCo = Conversions.ToString(LVYModule.ReturnIfNull(this.AdvTaiKhoan.Value, "", modGeneral.TypeOfValue.Nothing));
            objTUNCC.KhoaLoaiTien = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
            objTUNCC.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTUNCC.SoTienTamUngNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienTamUngNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTUNCC.SoTienTamUng = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienTamUng.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTUNCC.SoTienTraNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNhanNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTUNCC.SoTienTra = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNhan.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTUNCC.SoTienChiPhiNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChiPhiNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTUNCC.SoTienChiPhi = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChiPhi.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTUNCC.DienGiaiViet = this.TxtDienGiaiViet.Text;
            objTUNCC.DienGiaiAnh = this.TxtDienGiaiAnh.Text;
            objTUNCC.TyGiaThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyGiaChoThue.Value), 0, modGeneral.TypeOfValue.Nothing));
            return objTUNCC.Save();
            objTUNCC = null;
            return flag;
        }

        private void VSlistChiPhi_AfterEdit(object sender, RowColEventArgs e)
        {
            double num;
            double num2;
            double num4;
            switch (e.Col)
            {
                case 1:
                    this.VSlistChiPhi[e.Row, 1] = this.VSlistChiPhi[e.Row, 1].ToString().ToUpper();
                    break;

                case 12:
                    num = Conversions.ToDouble(this.VSlistChiPhi[e.Row, 12]);
                    num2 = LVYModule.SumColGrid(this.VSlistChiTietTamUng, 10);
                    num4 = Conversions.ToDouble(this.TxtTongTienTamUngNT.Value) - num2;
                    if (num < 0.0)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền trước thuế giao dịch kh\x00f4ng đ\x00fang!", ""));
                        this.VSlistChiPhi[e.Row, 12] = Microsoft.VisualBasic.CompilerServices.Operators.SubtractObject(this.TxtTongTienTamUngNT.Value, LVYModule.SumColGrid(this.VSlistChiTietTamUng, 10));
                    }
                    if (num > num4)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền trước thuế giao dịch kh\x00f4ng đ\x00fang!", ""));
                        this.VSlistChiPhi[e.Row, 12] = num4;
                    }
                    this.VSlistChiPhi[e.Row, 13] = Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiPhi[e.Row, 12], this.VSlistChiPhi[e.Row, 11]);
                    this.VSlistChiPhi[e.Row, 15] = Microsoft.VisualBasic.CompilerServices.Operators.DivideObject(Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiPhi[e.Row, 12], this.VSlistChiPhi[e.Row, 14]), 100);
                    this.VSlistChiPhi[e.Row, 0x10] = Microsoft.VisualBasic.CompilerServices.Operators.DivideObject(Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiPhi[e.Row, 13], this.VSlistChiPhi[e.Row, 14]), 100);
                    this.VSlistChiPhi[e.Row, 0x11] = RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 15]);
                    this.VSlistChiPhi[e.Row, 0x12] = RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x10]);
                    break;

                case 13:
                    num = Conversions.ToDouble(this.VSlistChiPhi[e.Row, 13]);
                    num2 = LVYModule.SumColGrid(this.VSlistChiTietTamUng, 11);
                    num4 = Conversions.ToDouble(this.TxtTongTienTamUng.Value) - num2;
                    if (num < 0.0)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền trước thuế giao dịch kh\x00f4ng đ\x00fang!", ""));
                        this.VSlistChiPhi[e.Row, 13] = Microsoft.VisualBasic.CompilerServices.Operators.SubtractObject(this.TxtTongTienTamUng.Value, LVYModule.SumColGrid(this.VSlistChiTietTamUng, 11));
                    }
                    if (num > num4)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền trước thuế giao dịch kh\x00f4ng đ\x00fang!", ""));
                        this.VSlistChiPhi[e.Row, 13] = num4;
                    }
                    this.VSlistChiPhi[e.Row, 0x10] = Microsoft.VisualBasic.CompilerServices.Operators.DivideObject(Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiPhi[e.Row, 13], this.VSlistChiPhi[e.Row, 14]), 100);
                    this.VSlistChiPhi[e.Row, 0x12] = RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x10]);
                    break;

                case 14:
                    if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectLess(this.VSlistChiPhi[e.Row, 14], 0, false))
                    {
                        this.VSlistChiPhi[e.Row, 14] = 0;
                    }
                    this.VSlistChiPhi[e.Row, 15] = Microsoft.VisualBasic.CompilerServices.Operators.DivideObject(Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiPhi[e.Row, 12], this.VSlistChiPhi[e.Row, 14]), 100);
                    this.VSlistChiPhi[e.Row, 0x10] = Microsoft.VisualBasic.CompilerServices.Operators.DivideObject(Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiPhi[e.Row, 13], this.VSlistChiPhi[e.Row, 14]), 100);
                    this.VSlistChiPhi[e.Row, 0x11] = RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 15]);
                    this.VSlistChiPhi[e.Row, 0x12] = RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x10]);
                    if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectGreater(this.VSlistChiPhi[e.Row, 14], 0, false))
                    {
                        string str;
                        clsDMDoiTuong tuong = new clsDMDoiTuong();
                        if (!tuong.Load(this.AdvKhachHang.Value))
                        {
                            return;
                        }
                        if (((((LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x18]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "") | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x19]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")) | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1d]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")) | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1a]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")) | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1b]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == ""))
                        {
                            str = Conversions.ToString(SearchModule.SearchKhaiBaoThue(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x16]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x17]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 2]), "", modGeneral.TypeOfValue.Nothing)), tuong.TenViet, tuong.MaSoThue, Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1c]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x13]), "", modGeneral.TypeOfValue.Nothing)), "", Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 30]), "", modGeneral.TypeOfValue.Nothing))));
                        }
                        else
                        {
                            str = Conversions.ToString(SearchModule.SearchKhaiBaoThue(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x16]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x17]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x18]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x19]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1a]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1b]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1c]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1d]), "", modGeneral.TypeOfValue.Nothing)), "", Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 30]), "", modGeneral.TypeOfValue.Nothing))));
                        }
                        if (str != "")
                        {
                            object instance = Strings.Split(str, "|", -1, CompareMethod.Binary);
                            this.VSlistChiPhi[e.Row, 0x16] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                            this.VSlistChiPhi[e.Row, 0x17] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                            this.VSlistChiPhi[e.Row, 0x18] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
                            this.VSlistChiPhi[e.Row, 0x19] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 3 }, null));
                            this.VSlistChiPhi[e.Row, 0x1a] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 4 }, null));
                            this.VSlistChiPhi[e.Row, 0x1b] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 5 }, null));
                            this.VSlistChiPhi[e.Row, 0x1c] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 6 }, null));
                            this.VSlistChiPhi[e.Row, 0x1d] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 7 }, null));
                            this.VSlistChiPhi[e.Row, 30] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 8 }, null));
                            this.VSlistChiPhi.Select(e.Row, 14);
                        }
                        this.VSlistChiPhi[e.Row, 0x15] = true;
                    }
                    break;

                case 0x11:
                    if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 14]), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Hiện tại bạn kh\x00f4ng thể thay đổi Số tiền khấu trừ VAT (Giao dịch)!", ""));
                        this.VSlistChiPhi[e.Row, 0x11] = 0;
                        return;
                    }
                    if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x11]), 0, modGeneral.TypeOfValue.Nothing)) < 0.0)
                    {
                        this.VSlistChiPhi[e.Row, 0x11] = RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 15]);
                    }
                    this.VSlistChiPhi[e.Row, 0x12] = Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiPhi[e.Row, 0x11], this.VSlistChiPhi[e.Row, 11]);
                    break;

                case 0x12:
                    if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 14]), 0, modGeneral.TypeOfValue.Nothing)) != 0.0)
                    {
                        if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x12]), 0, modGeneral.TypeOfValue.Nothing)) < 0.0)
                        {
                            this.VSlistChiPhi[e.Row, 0x12] = RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x10]);
                        }
                        break;
                    }
                    LVYModule.ShowWarning(modGeneral.Tranlated("Hiện tại bạn kh\x00f4ng thể thay đổi Số tiền khấu trừ VAT (Ghi sổ)!", ""));
                    this.VSlistChiPhi[e.Row, 0x12] = 0;
                    break;

                case 0x15:
                {
                    if (!Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlistChiPhi[e.Row, 0x15], true, false))
                    {
                        this.VSlistChiPhi[e.Row, 0x16] = "";
                        this.VSlistChiPhi[e.Row, 0x17] = "";
                        this.VSlistChiPhi[e.Row, 0x18] = "";
                        this.VSlistChiPhi[e.Row, 0x19] = null;
                        this.VSlistChiPhi[e.Row, 0x1a] = "";
                        this.VSlistChiPhi[e.Row, 0x1b] = "";
                        this.VSlistChiPhi[e.Row, 0x1c] = "";
                        this.VSlistChiPhi[e.Row, 0x1d] = "";
                        break;
                    }
                    clsDMDoiTuong tuong2 = new clsDMDoiTuong();
                    if (tuong2.Load(this.AdvKhachHang.Value))
                    {
                        string str2;
                        if (((((LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x18]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "") | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x19]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")) | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1d]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")) | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1a]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")) | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1b]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == ""))
                        {
                            str2 = Conversions.ToString(SearchModule.SearchKhaiBaoThue(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x16]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x17]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 2]), "", modGeneral.TypeOfValue.Nothing)), tuong2.TenViet, tuong2.MaSoThue, Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1c]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x13]), "", modGeneral.TypeOfValue.Nothing)), "", Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 30]), "", modGeneral.TypeOfValue.Nothing))));
                        }
                        else
                        {
                            str2 = Conversions.ToString(SearchModule.SearchKhaiBaoThue(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x16]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x17]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x18]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x19]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1a]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1b]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1c]), "", modGeneral.TypeOfValue.Nothing)), Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 0x1d]), "", modGeneral.TypeOfValue.Nothing)), "", Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiPhi[e.Row, 30]), "", modGeneral.TypeOfValue.Nothing))));
                        }
                        if (str2 != "")
                        {
                            object obj3 = Strings.Split(str2, "|", -1, CompareMethod.Binary);
                            this.VSlistChiPhi[e.Row, 0x16] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 0 }, null));
                            this.VSlistChiPhi[e.Row, 0x17] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 1 }, null));
                            this.VSlistChiPhi[e.Row, 0x18] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 2 }, null));
                            this.VSlistChiPhi[e.Row, 0x19] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 3 }, null));
                            this.VSlistChiPhi[e.Row, 0x1a] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 4 }, null));
                            this.VSlistChiPhi[e.Row, 0x1b] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 5 }, null));
                            this.VSlistChiPhi[e.Row, 0x1c] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 6 }, null));
                            this.VSlistChiPhi[e.Row, 0x1d] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 7 }, null));
                            this.VSlistChiPhi[e.Row, 30] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj3, new object[] { 8 }, null));
                            this.VSlistChiPhi.Select(e.Row, 14);
                        }
                        this.VSlistChiPhi[e.Row, 0x15] = true;
                        break;
                    }
                    return;
                }
            }
            this.TinhTong();
        }

        private void VSlistChiPhi_BeforeEdit(object sender, RowColEventArgs e)
        {
            if ((((((e.Col == 10) | (e.Col == 11)) | (e.Col == 15)) | (e.Col == 0x10)) | (e.Col == 7)) | (e.Col == 8))
            {
                e.Cancel = true;
            }
        }

        private void VSlistChiPhi_CellButtonClick(object sender, RowColEventArgs e)
        {
            string expression = "";
            if (e.Col == 4)
            {
                expression = SearchModule.SearchTaiKhoan("", "627|635|641|642|8", "Left(SoTaiKhoan,3)", "", "");
                if (expression != "")
                {
                    object instance = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                    this.VSlistChiPhi[e.Row, 3] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                    this.VSlistChiPhi[e.Row, 4] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                    this.VSlistChiPhi[e.Row, 5] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
                    this.VSlistChiPhi.Select(e.Row, 7);
                }
                else
                {
                    this.VSlistChiPhi[e.Row, 3] = "";
                    this.VSlistChiPhi[e.Row, 4] = "";
                    this.VSlistChiPhi[e.Row, 5] = "";
                }
            }
        }

        private void VSlistChiTietTamUng_AfterEdit(object sender, RowColEventArgs e)
        {
            double num;
            switch (e.Col)
            {
                case 1:
                    this.VSlistChiTietTamUng[e.Row, 1] = this.VSlistChiTietTamUng[e.Row, 1].ToString().ToUpper();
                    break;

                case 8:
                    num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[e.Row, 8]), 0, modGeneral.TypeOfValue.Nothing));
                    if (num < 0.0)
                    {
                        this.VSlistChiTietTamUng[e.Row, 8] = RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value);
                    }
                    if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectGreater(num, this.TxtTongTienTamUngNT.Value, false))
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền trả trước giao dịch kh\x00f4ng đ\x00fang!", ""));
                        this.VSlistChiTietTamUng[e.Row, 8] = RuntimeHelpers.GetObjectValue(this.TxtTongTienTamUngNT.Value);
                    }
                    this.VSlistChiTietTamUng[e.Row, 9] = Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiTietTamUng[e.Row, 8], this.VSlistChiTietTamUng[e.Row, 7]);
                    this.VSlistChiTietTamUng[e.Row, 10] = RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[e.Row, 8]);
                    this.VSlistChiTietTamUng[e.Row, 11] = Microsoft.VisualBasic.CompilerServices.Operators.MultiplyObject(this.VSlistChiTietTamUng[e.Row, 10], this.VSlistChiTietTamUng[e.Row, 7]);
                    break;

                case 11:
                    num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[e.Row, 11]), 0, modGeneral.TypeOfValue.Nothing));
                    if (num < 0.0)
                    {
                        this.VSlistChiTietTamUng[e.Row, 11] = RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[e.Row, 9]);
                    }
                    if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectGreater(num, this.TxtTongTienTamUng.Value, false))
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền trả trước thực tế kh\x00f4ng đ\x00fang!", ""));
                        this.VSlistChiTietTamUng[e.Row, 11] = RuntimeHelpers.GetObjectValue(this.VSlistChiTietTamUng[e.Row, 9]);
                    }
                    break;
            }
            this.TinhTong();
        }

        private void VSlistChiTietTamUng_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (((((e.Col == 4) | (e.Col == 6)) | (e.Col == 7)) | (e.Col == 9)) | (e.Col == 10))
            {
                e.Cancel = true;
            }
        }

        internal virtual ADVObjects AdvKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvKhachHang_ValueChanged);
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged -= handler;
                }
                this._AdvKhachHang = value;
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVObjects AdvNganHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNganHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNganHang_ValueChanged);
                if (this._AdvNganHang != null)
                {
                    this._AdvNganHang.ValueChanged -= handler;
                }
                this._AdvNganHang = value;
                if (this._AdvNganHang != null)
                {
                    this._AdvNganHang.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVAccount.ValueChangedEventHandler handler = new ADVAccount.ValueChangedEventHandler(this.AdvTaiKhoan_ValueChanged);
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged -= handler;
                }
                this._AdvTaiKhoan = value;
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiKhachHang_SelectedIndexChanged);
                if (this._CboLoaiKhachHang != null)
                {
                    this._CboLoaiKhachHang.SelectedIndexChanged -= handler;
                }
                this._CboLoaiKhachHang = value;
                if (this._CboLoaiKhachHang != null)
                {
                    this._CboLoaiKhachHang.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox cboLoaiTienKhaiBaoThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cboLoaiTienKhaiBaoThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cboLoaiTienKhaiBaoThue_SelectedIndexChanged);
                if (this._cboLoaiTienKhaiBaoThue != null)
                {
                    this._cboLoaiTienKhaiBaoThue.SelectedIndexChanged -= handler;
                }
                this._cboLoaiTienKhaiBaoThue = value;
                if (this._cboLoaiTienKhaiBaoThue != null)
                {
                    this._cboLoaiTienKhaiBaoThue.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboPhuongThuc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboPhuongThuc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboPhuongThuc_SelectedIndexChanged);
                if (this._CboPhuongThuc != null)
                {
                    this._CboPhuongThuc.SelectedIndexChanged -= handler;
                }
                this._CboPhuongThuc = value;
                if (this._CboPhuongThuc != null)
                {
                    this._CboPhuongThuc.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripSplitButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdPrint = value;
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button CmdThemDongChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdThemDongChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdThemDongChiPhi_Click);
                if (this._CmdThemDongChiPhi != null)
                {
                    this._CmdThemDongChiPhi.Click -= handler;
                }
                this._CmdThemDongChiPhi = value;
                if (this._CmdThemDongChiPhi != null)
                {
                    this._CmdThemDongChiPhi.Click += handler;
                }
            }
        }

        internal virtual Button CmdThemDongChiTiet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdThemDongChiTiet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdThemDongChiTiet_Click);
                if (this._CmdThemDongChiTiet != null)
                {
                    this._CmdThemDongChiTiet.Click -= handler;
                }
                this._CmdThemDongChiTiet = value;
                if (this._CmdThemDongChiTiet != null)
                {
                    this._CmdThemDongChiTiet.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdXemDinhKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdXemDinhKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdXemDinhKhoan_Click);
                if (this._CmdXemDinhKhoan != null)
                {
                    this._CmdXemDinhKhoan.Click -= handler;
                }
                this._CmdXemDinhKhoan = value;
                if (this._CmdXemDinhKhoan != null)
                {
                    this._CmdXemDinhKhoan.Click += handler;
                }
            }
        }

        internal virtual Button CmdXoaDongChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdXoaDongChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdXoaDongChiPhi_Click);
                if (this._CmdXoaDongChiPhi != null)
                {
                    this._CmdXoaDongChiPhi.Click -= handler;
                }
                this._CmdXoaDongChiPhi = value;
                if (this._CmdXoaDongChiPhi != null)
                {
                    this._CmdXoaDongChiPhi.Click += handler;
                }
            }
        }

        internal virtual Button CmdXoaDongChiTiet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdXoaDongChiTiet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdXoaDongChiTiet_Click);
                if (this._CmdXoaDongChiTiet != null)
                {
                    this._CmdXoaDongChiTiet.Click -= handler;
                }
                this._CmdXoaDongChiTiet = value;
                if (this._CmdXoaDongChiTiet != null)
                {
                    this._CmdXoaDongChiTiet.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value;
                this.CmdEdit.Enabled = !value;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CboPhuongThuc.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.cboLoaiTienKhaiBaoThue.Enabled = value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.AdvKhachHang.ReadOnly = !value;
                this.TxtNguoiNhan.ReadOnly = !value;
                this.AdvTaiKhoan.ReadOnly = !value;
                this.AdvNganHang.ReadOnly = !value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtTongTienTamUngNT.ReadOnly = !value;
                this.TxtTongTienTamUng.ReadOnly = !value;
                this.TxtDienGiaiViet.ReadOnly = !value;
                this.TxtDienGiaiAnh.ReadOnly = !value;
                this.CboLoaiKhachHang.Enabled = value;
                this.TxtTyGiaChoThue.ReadOnly = !value;
                this.CmdThemDongChiPhi.Enabled = value;
                this.CmdThemDongChiTiet.Enabled = value;
                this.CmdXoaDongChiPhi.Enabled = value;
                this.CmdXoaDongChiTiet.Enabled = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual Panel Panel6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel6 = value;
            }
        }

        internal virtual ToolStripMenuItem PrintCT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PrintCT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PrintCT = value;
            }
        }

        internal virtual ToolStripMenuItem PrintTH
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PrintTH;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PrintTH = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabControl2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl2 = value;
            }
        }

        internal virtual TabControl TabControl3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl3 = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual TabPage TabPage3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage3 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChiPhi = value;
            }
        }

        internal virtual C1NumericEdit TxtChiPhiNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChiPhiNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChiPhiNT = value;
            }
        }

        internal virtual C1NumericEdit TxtChiPhiTruocThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChiPhiTruocThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChiPhiTruocThue = value;
            }
        }

        internal virtual C1NumericEdit TxtConDu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtConDu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtConDu = value;
            }
        }

        internal virtual C1NumericEdit TxtConDuNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtConDuNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtConDuNT = value;
            }
        }

        internal virtual TextBox TxtDienGiaiAnh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiaiAnh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtDienGiaiAnh_TextChanged);
                if (this._TxtDienGiaiAnh != null)
                {
                    this._TxtDienGiaiAnh.TextChanged -= handler;
                }
                this._TxtDienGiaiAnh = value;
                if (this._TxtDienGiaiAnh != null)
                {
                    this._TxtDienGiaiAnh.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TxtDienGiaiViet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiaiViet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtDienGiaiViet_TextChanged);
                if (this._TxtDienGiaiViet != null)
                {
                    this._TxtDienGiaiViet.TextChanged -= handler;
                }
                this._TxtDienGiaiViet = value;
                if (this._TxtDienGiaiViet != null)
                {
                    this._TxtDienGiaiViet.TextChanged += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual TextBox TxtNguoiNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNguoiNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNguoiNhan = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoChungTu_TextChanged);
                if (this._TxtSoChungTu != null)
                {
                    this._TxtSoChungTu.TextChanged -= handler;
                }
                this._TxtSoChungTu = value;
                if (this._TxtSoChungTu != null)
                {
                    this._TxtSoChungTu.TextChanged += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtSoTienNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienNhan = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienNhanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienNhanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienNhanNT = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienTamUng
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienTamUng;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienTamUng = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienTamUngNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienTamUngNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienTamUngNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongCongThueChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongCongThueChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongCongThueChiPhi = value;
            }
        }

        internal virtual C1NumericEdit TxtTongTienTamUng
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongTienTamUng;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongTienTamUng = value;
            }
        }

        internal virtual C1NumericEdit TxtTongTienTamUngNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongTienTamUngNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTongTienTamUngNT_ValueChanged);
                EventHandler handler2 = new EventHandler(this.TxtTongTienTamUngNT_LostFocus);
                if (this._TxtTongTienTamUngNT != null)
                {
                    this._TxtTongTienTamUngNT.ValueChanged -= handler;
                    this._TxtTongTienTamUngNT.LostFocus -= handler2;
                }
                this._TxtTongTienTamUngNT = value;
                if (this._TxtTongTienTamUngNT != null)
                {
                    this._TxtTongTienTamUngNT.ValueChanged += handler;
                    this._TxtTongTienTamUngNT.LostFocus += handler2;
                }
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.txtTyGia_TextChanged);
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.TextChanged -= handler;
                }
                this._txtTyGia = value;
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.TextChanged += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTyGiaChoThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTyGiaChoThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTyGiaChoThue_TextChanged);
                if (this._TxtTyGiaChoThue != null)
                {
                    this._TxtTyGiaChoThue.ValueChanged -= handler;
                }
                this._TxtTyGiaChoThue = value;
                if (this._TxtTyGiaChoThue != null)
                {
                    this._TxtTyGiaChoThue.ValueChanged += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtVAT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtVAT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtVAT = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlistChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlistChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSlistChiPhi_CellButtonClick);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSlistChiPhi_AfterEdit);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSlistChiPhi_BeforeEdit);
                if (this._VSlistChiPhi != null)
                {
                    this._VSlistChiPhi.CellButtonClick -= handler;
                    this._VSlistChiPhi.AfterEdit -= handler2;
                    this._VSlistChiPhi.BeforeEdit -= handler3;
                }
                this._VSlistChiPhi = value;
                if (this._VSlistChiPhi != null)
                {
                    this._VSlistChiPhi.CellButtonClick += handler;
                    this._VSlistChiPhi.AfterEdit += handler2;
                    this._VSlistChiPhi.BeforeEdit += handler3;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlistChiTietTamUng
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlistChiTietTamUng;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSlistChiTietTamUng_BeforeEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSlistChiTietTamUng_AfterEdit);
                if (this._VSlistChiTietTamUng != null)
                {
                    this._VSlistChiTietTamUng.BeforeEdit -= handler;
                    this._VSlistChiTietTamUng.AfterEdit -= handler2;
                }
                this._VSlistChiTietTamUng = value;
                if (this._VSlistChiTietTamUng != null)
                {
                    this._VSlistChiTietTamUng.BeforeEdit += handler;
                    this._VSlistChiTietTamUng.AfterEdit += handler2;
                }
            }
        }
    }
}

